如何使用tomcat7插件从父pom中排除子战部署?

时间:2016-08-22 15:52:43

标签: maven deployment tomcat7

我的父pom有七个模块,其中五个包jar,另外两个包war。我希望使用mvn tomcat7部署其中一场战争而不是另一场战争。

  

父POM:

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
</plugin>
  

部署POM:

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <configuration>
        <url>http://localhost:8080/manager/text</url>
        <server>TomcatServer</server>
        <path>/mywebapp</path>
    </configuration>
</plugin>

未部署的POM不会声明任何tomcat7 maven插件。但是,当我在父POM级别运行mvn tomcat7:redeploy时,它希望部署打包战争的每个POM,在部署的POM上成功并在未部署的POM上失败:

[INFO] Deployed WAR artifact ......................................... SUCCESS [ 49.072 s]
[INFO] Non-deployed WAR artifact ..................................... FAILURE [  0.594 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 57.209 s
[INFO] Finished at: 2016-08-22T11:49:01-04:00
[INFO] Final Memory: 60M/704M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'tomcat7' in the current project and in the plugin groups [org.apache.maven
.plugins, org.codehaus.mojo] available from the repositories [local (D:\DATA\.m2), central (https://repo.maven
.apache.org/maven2)] -> [Help 1]
[ERROR]

如何在运行mvn tomcat7:redeploy时将第二个工件排除在部署状态,同时仍将WAR文件重建在目标目录中?

0 个答案:

没有答案