Maven Pofile 打war包时排除某个jar
参考:http://stackoverflow.com/questions/13819558/maven-profile-removing-dependency
反过来想,激活某个profile时将该jar添加进dependencies
比如:持续集成时(profile ci),需要使用某一个Jar,但发布生产时(profile prod),需要将该jar排除
<profiles>
<profile>
<id>ci</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>prod</id>
<dependencies>
</dependencies>
</profile>
</profiles>
本文介绍如何使用Maven配置Profiles来管理不同环境下的依赖项。通过示例展示了如何为持续集成环境(ci)添加特定的依赖(log4j),并在生产环境(prod)中排除这些依赖。
1235

被折叠的 条评论
为什么被折叠?



