使用android maven插件的核心库

我想用android的nativ库。 当我尝试与我的项目合作

mvn clean install 

我收到一个错误

[INFO] If you really intend to build a core library -- which is only
[INFO] appropriate as part of creating a full virtual machine
[INFO] distribution, as opposed to compiling an application -- then use
[INFO] the "--core-library" option to suppress this error message.

如何将--core-library参数添加到pom.xml中?

我的POM看起来像

http://maven.apache.org/maven-v4_0_0.xsd“> 4.0.0

<parent>
    <groupId>com.temp</groupId>
    <artifactId>SipAndroidClient</artifactId>
    <version>0.1</version>
</parent>

<artifactId>android-di</artifactId>
<packaging>apk</packaging>
<name>android-di - Application</name>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>1.9.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.pivotallabs</groupId>
        <artifactId>robolectric</artifactId>
        <version>1.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.google.android</groupId>
        <artifactId>android</artifactId>
    </dependency>
    <dependency>
        <groupId>org.roboguice</groupId>
        <artifactId>roboguice</artifactId>
        <version>2.0</version>
    </dependency>
    <dependency>
        <groupId>de.mindpipe.android</groupId>
        <artifactId>android-logging-log4j</artifactId>
        <version>1.0.3</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.2</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.2</version>
    </dependency>
    <dependency>
        <groupId>javax.sip</groupId>
        <artifactId>jain-sip-api</artifactId>
        <version>1.2.1.4</version>
    </dependency>
    <dependency>
        <groupId>javax.sip</groupId>
        <artifactId>jain-sip-ri</artifactId>
        <version>1.2.167</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <configuration>
                <androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
                <assetsDirectory>${project.basedir}/assets</assetsDirectory>
                <resourceDirectory>${project.basedir}/res</resourceDirectory>
                <nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
                <sdk>
                    <platform>10</platform>
                    <path>/home/damian/.android-sdk</path>
                </sdk>
                <undeployBeforeDeploy>true</undeployBeforeDeploy>
            </configuration>
            <extensions>true</extensions>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.0</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
</build>


我相信这就是你正在寻找的http://maven-android-plugin-m2site.googlecode.com/svn/dex-mojo.html

看看dex部分,将CoreLibrary设置为true会将“--core-library”发送到dex。

链接地址: http://www.djcxy.com/p/86183.html

上一篇: Core libraries with android maven plugin

下一篇: I am not able launch JNLP applications using "Java Web Start"?