是否可以为特定的maven命令添加目标?

时间:2014-02-06 02:30:44

标签: java android maven

我想执行maven mvn android:instrument for mvn test。这可能吗? 你可以通过指定我为pom做的改变来帮助我吗?

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
    http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.sample.projectfoundation</groupId>
        <artifactId>androidsdktest</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <packaging>apk</packaging>
        <name>AndroidSDKTest</name>
        <dependencies>
            <dependency>
                <groupId>com.sample.projectfoundation</groupId>
                <artifactId>androidsdk</artifactId>
                <version>0.0.1-SNAPSHOT</version>
            </dependency>
            <dependency>
                <groupId>com.google.android</groupId>
                <artifactId>android</artifactId>
                <version>2.2.1</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.google.android</groupId>
                <artifactId>android-test</artifactId>
                <version>2.3.1</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>  
        <build>
            <finalName>${project.artifactId}</finalName>
            <sourceDirectory>src</sourceDirectory>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                        <artifactId>android-maven-plugin</artifactId>            
                        <version>3.5.3</version>
                        <extensions>true</extensions>
                    </plugin>
                </plugins>
            </pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                    <artifactId>android-maven-plugin</artifactId>
                    <configuration>
                        <sdk>
                            <!-- platform or api level (api level 4 = platform 1.6) -->
                            <platform>19</platform>
                        </sdk>
                        <emulator>
                            <avd>mydevice</avd>
                            <!-- Wait for emulator starting (3 minutes) -->
                            <wait>180000</wait>
                            <options>-no-skin</options>
                        </emulator>
                    </configuration>
                </plugin>
            </plugins>
        </build>    
</project> 

0 个答案:

没有答案