我希望在我的pom文件中排除log4j。它甚至在远程存储库中也不可用。我在父pom文件中有一个版本为4.0.0的属性。
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.3.0</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
<configuration>
<excludes>
<exclude>**/log4j*</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
它根本不起作用;我一直收到下面的消息。Execution scala-compile-first of goal net.alchim31.maven:scala-maven-plugin:4.3.0:add-source failed: Plugin net.alchim31.maven:scala-maven-plugin:4.3.0 or one of its dependencies could not be resolved: Failure to find org.apache.logging.log4j:log4j-core:jar:2.11.2
1条答案
按热度按时间0dxa2lsx1#
scala-maven-plugin中的
excludes
配置节用于过滤要编译的资源。如果log4j是一个依赖项(已经编译过),那么必须找到是什么将它拉入构建并将其排除(或者设置一个全局依赖项排除规则)。