Maven Exec Plugin을 사용하여 cmd
명령을 실행할 수 있습니다.
귀하의 경우에는
<project>
...
<build>
<plugins>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>1.2.1</version>
<executions>
<execution>
<id>My Command Runner</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>ping</executable>
<arguments>
<argument>8.8.8.8</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
</project>
, 내부 configuration
것 : 아래의 조각 (A pom.xml
에 추가)에서
, 때마다 실행됩니다 8.8.8.8
인수로 명령 ping
당신은 mvn install
할 주위에 있으십시오 :
<configuration>
<executable>adb </executable>
<arguments>
<argument>shell</argument>
<argument>instrument</argument>
<argument>-e</argument>
<argument>classname#testcasename</argument>
<argument>-w</argument>
<argument>packagename/instrumenation</argument>
</arguments>
</configuration>
정말 필요한 단계에 바인딩해야합니다. 위의 예는 설명한대로 mvn install
에 바인딩되어 있습니다. 즉 누군가가 (install
) 단계를 실행할 때 명령이 실행됨을 의미합니다.
Windows OS 및 에뮬레이터에서이 작업을 수행하고 있습니다. 거기에/시스템/bin/쉬고있어 : 악기 : 오류를 찾을 수 없습니다. –
죄송합니다. 나는 잘못된 주장을했습니다. Thxs acdcjunior. –