Core libraries with android maven plugin

I want to use nativ libraries with android. When i try to complie my project with

mvn clean install 

I get an error

[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.

How to add --core-library param to pom.xml ?

My pom looks like

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>


I believe this is what you are looking for http://maven-android-plugin-m2site.googlecode.com/svn/dex-mojo.html

Have a look at the dex section, setting CoreLibrary to true will send "--core-library" to dex.

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

上一篇: 为什么C需要“struct”关键字而不是C ++?

下一篇: 使用android maven插件的核心库