当前位置: 动力学知识库 > 问答 > 编程问答 >

how to let maven war plugin to create multiple war file

问题描述:

i used selenium-mave-plugin for integration test, which require the war file named: project.artifactId-version(say: myproj-0.1-SNAPSHOT.war) while the default war created by maven-war-plugin is project.artifactId.war(say myproj-SNAPSHOT.war).

in order to let selenium plugin, i override the maven-war-plugin in that selenium profile as:

 <plugin>

<artifactId>maven-war-plugin</artifactId>

<version>2.1-beta-1</version>

<configuration>

<warName>${project.artifactId}-${project.version}</warName>

</configuration>

</plugin>

now when i build the project, it failed at rpm:rpm, complaining:

source location ..../myProj.war does not exist

my question is if it's possible to create 2 war files: myProj.war and myProj-0.1-SNAPSHOT.war so both rpm and selenium plugins are happy? Thanks

网友答案:

For rpm plugin, please make sure you use the location directive. If you need further help, please post your full pom.xml.

As for selenium, it doesn't really need to know where your .war file resides. Only the web application server needs to know. Sadly, you didn't provide information in which phase of maven the "does not exist" error occured. So I can only guess it's while starting jetty, tomcat or another web application server.

You should run your full build (including tests) with: mvn clean verify integration-test rpm:prm.

分享给朋友:
您可能感兴趣的文章:
随机阅读: