0
在Maven項目中,我使用maven-exec-plugin來啓動我的Grunt測試。它是這樣的:正確綁定maven exec插件到測試階段
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>cmd</executable>
<workingDirectory>${project.basedir}/src/main/webapp</workingDirectory>
<arguments>
<argument>/C</argument>
<argument>grunt --no-color test</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
有了,我可以運行mvn test
和我的呼嚕聲test
任務將被執行:如果測試通過,Maven構建通,如果測試失敗的Maven構建失敗。當一些測試失敗,我有以下的輸出:
............................................. 1 failing
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.496s
[INFO] Finished at: ** ** ** **:**:** CEST ****
[INFO] Final Memory: *M/*M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default) on project *****: Command execution failed. Process exited with an error: 6 (Exit value: 6) -> [Help 1]
我想知道是否有可能有失敗的測試的「常態」行家輸出。例如:Build failure, there are failing tests
。
謝謝
是啊,這就是我擔心。感謝指向'grunt-maven-plugin'的指針,儘管我更喜歡使用'exec-maven-plugin'。 – htulipe