Java 消除maven warrning:我们有一个复制品
在我的TestService项目中,我有以下pom.xml:Java 消除maven warrning:我们有一个复制品,java,maven,Java,Maven,在我的TestService项目中,我有以下pom.xml: <dependencies> <dependency> <groupId>${project.groupId}</groupId> <artifactId>AnotherProject</artifactId> <version>${project.version}</version> </dependency&g
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>AnotherProject</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
${project.groupId}
另一个项目
${project.version}
及
maven阴影插件
1.7
真的
${mainClass}
*:*
META-INF/*.SF
META-INF/*.DSA
META-INF/*.RSA
包裹
阴凉处
maven jar插件
2.4
真的
${mainClass}
在我的另一个项目pom.xml中具有相同的maven jar插件和maven shade插件配置
我的问题是:
1) 为什么我看到这样的警告:
[警告]中有重复的org/apache/juli/logging/Log.class
/home/xxx/.m2/repository/me/xxx/AnotherProject/1.0-SNAPSHOT/AnotherProject-1.0-SNAPSHOT.jar
如果我没有在我的测试服务中明确包含此apache依赖项
2) 我试图通过使用jar插件中的true
和TestService中的true
来消除这些警告,因为它不会给出结果。我做错什么了吗?正确的方法是什么
(三)
如果可能,我如何关闭所有此类[警告]?我不想在构建过程中使用-q选项
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>1.7</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${mainClass}</mainClass>
</transformer>
</transformers>
<!-- exclude signed Manifests -->
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${mainClass}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugins>
<build>