Maven: avoid deploying project package-implied artifact during standard build lifecycle

我与影子孤独终老i 提交于 2019-12-01 18:01:37

According to the Maven Deploy Plugin documentation:

deploy:deploy is used to automatically install the artifact, its pom and the attached artifacts produced by a particular project. [...]

So I don't think it's possible to prevent your war from being deployed "as is".

However, to obtain the desired effect, you could add a specific module to your build that would be in charge of producing the assembly (the assembly would depend on the war module) and configure the deploy plugin in the war module to skip deployment as follows:

         <plugin>
           <artifactId>maven-deploy-plugin</artifactId>
           <version>X.Y</version>
           <configuration>
             <skip>true</skip>
           </configuration>
         </plugin>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!