2011-08-23 16 views
0

我使用的貨物Maven插件,以我的應用程序部署到集成測試GlassFish的容器:如何在部署失敗時強制Cargo Maven插件產生錯誤而不是信息或警告?

 <plugin> 
      <groupId>org.codehaus.cargo</groupId> 
      <artifactId>cargo-maven2-plugin</artifactId> 

      <executions> 
      <execution> 
       <id>pre-integration-test</id> 
       <phase>pre-integration-test</phase> 
       <goals> 
       <goal>redeploy</goal> 
       </goals> 
      </execution> 
      </executions> 

      <configuration> 
      <container> 
       <containerId>glassfish3x</containerId> 
       <home>${glassfish.home}</home>     
      </container> 

      <configuration> 
       <properties> 
       <cargo.servlet.port>8081</cargo.servlet.port> 
       <cargo.glassfish.adminPort>4849</cargo.glassfish.adminPort> 
       <cargo.remote.username>${domain.username}</cargo.remote.username> 
       <cargo.remote.password>${domain.password}</cargo.remote.password> 
       <cargo.glassfish.domain.name>domain1</cargo.glassfish.domain.name> 
       </properties> 
      </configuration> 

      <deployer> 
       <type>installed</type> 
       <deployables> 
       <deployable> 
        <groupId>de.rwth.swc.xam</groupId> 
        <artifactId>${project.artifactId}</artifactId> 
        <type>ear</type> 
       </deployable> 
       </deployables> 
      </deployer> 
      </configuration> 
     </plugin> 

集成測試是由哈德森執行。 如果部署失敗(不管是什麼原因),貨物插件產生只是一個警告是這樣的:

[INFO] [talledLocalContainer] Deprecated syntax, instead use: 
[INFO] [talledLocalContainer] asadmin --interactive=false --port 4849 --user admin -passwordfile /opt/glassfishv3/.hudson/jobs/XAM Test.Setup.Application/workspace/target/cargo/configurations/glassfish3x/password.properties deploy [options] ... 
[WARNING] [talledLocalContainer] remote failure: Error occurred during deployment: Application with name de.rwth.swc.xam.tests.ear-0.0.1-SNAPSHOT is already registered. Either specify that redeployment must be forced, or redeploy the application. Or if this is a new deployment, pick a different name. Please see server.log for more details. 
[INFO] [talledLocalContainer] Command deploy failed. 

的問題是,這會導致在構建是sucessfull,因此觸發其他版本。

有沒有辦法,我可以強制貨物產生一個maven構建錯誤,而不是一個信息,如果部署命令失敗?

回答

0

基於Maven 2 Plugin的來源,它看起來不像這樣。但我認爲我們應該提出一個關於這個問題的文件,因爲它可能有用。

+0

我創建了一個增強權證:http://jira.codehaus.org/browse/CARGO-1032 – Matthias

相關問題