我對maven並不熟悉。不過,我知道這是一個流行的構建框架。所以,我創建了一個下面的pom.xml,並希望執行命令行測試「MVN ATF:ITEST」:我想通過「mvn atf:itest」執行test.sh給定的pom
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>john.test</groupId>
<artifactId>Maventest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Maventest</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>atf</groupId>
<artifactId>itest</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>ITest</id>
<phase>Testing</phase>
<goals>
<goal>itest</goal>
</goals>
<configuration>
<executable>${basedir}/scripts/test.py</executable>
<arguments>
<argument>-s</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
什麼建議嗎?
在此先感謝!
我只是提到 「https://sanchitbahal.wordpress.com/2011/09/19/maven-exec-plugin-vs-maven-antrun-plugin-for-running-command-line-tool/」。但是,它並沒有提供完整的pom.xml和在插件中執行命令的命令。 – johnklee