我正在使用Maven -assembly-plugin並獲取大量的INFO消息,其中列出了所有將被省略的重複條目。有沒有辦法將log4j級別設置爲「WARN」來執行此單個插件?如何爲單個Maven插件執行設置log4j級別?
<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
...
在我的情況我有大約這些[INFO]消息3000。這擴大了Maven構建輸出,並且使得看到真正的錯誤變得更加困難。
感謝,
馬克