我想删除maven pom.xml中的重复依赖项。删除Maven Pom中的重复依赖项
我想多个工具的答案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'的重复依赖关系,你不能手动处理它们,我真的不确定开发一个自定义解决方案来移除它们的成本是值得的低成本离开他们和/或纠正他们,因为你找到他们。 – Aaron