【发布时间】:2017-12-31 15:49:00
【问题描述】:
我想删除 maven pom.xml 中的重复依赖项。
我想要多个工具 Linux、Notepad++、Netbeans、Intellij ...甚至...VIM 等的答案。
示例(我可以明显删除但我想要搜索替换答案)
`<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-jetty-http</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-jetty-http</artifactId>
<version>2.7</version>
</dependency>`
请在本地写下答案链接如果被删除可能会令人沮丧。谢谢。
【问题讨论】:
-
通用的最佳实践解决方案显然是首先避免添加重复的依赖项。一旦你有足够的
pom.xml具有无法手动处理它们的重复依赖项,我真的不确定开发自定义解决方案以删除它们的成本是否值得离开的成本可能很低它们和/或在找到它们时更正它们。
标签: linux windows maven netbeans notepad++