我正在使用 Maven -assembly-plugin 并获得大量的 INFO 消息,其中列出了所有被省略的重复条目。有没有办法为这个单一的插件执行设置 log4j 级别为“WARN”?
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<outputDirectory>${basedir}/../package/lib</outputDirectory>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
例如,请注意此步骤的以下 log4j 输出示例中的重复项:
...
[INFO] META-INF/notice.txt already added, skipping
[INFO] META-INF/spring.handlers already added, skipping
[INFO] META-INF/spring.schemas already added, skipping
[INFO] META-INF/spring.tooling already added, skipping
[INFO] META-INF/INDEX.LIST already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] META-INF/license.txt already added, skipping
[INFO] META-INF/notice.txt already added, skipping
[INFO] overview.html already added, skipping
[INFO] META-INF/INDEX.LIST already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] META-INF/license.txt already added, skipping
[INFO] META-INF/notice.txt already added, skipping
[INFO] META-INF/spring.handlers already added, skipping
[INFO] META-INF/spring.schemas already added, skipping
[INFO] META-INF/spring.tooling already added, skipping
...
就我而言,我有大约 3,000 条这些 [INFO] 消息。这会使 Maven 构建输出膨胀,并且更难看到真正的错误。
谢谢,
标记