运行Maven构建时我的控制台输出被
污染[INFO] Logged in - repository.hid.com
[INFO] Downloading: s3://repository.hid.com/release/org/slf4j/slf4j-api/1.7.6/slf4j-api-1.7.6.pom
[INFO] Logged off - repository.hid.com
[INFO] Transfers: 1 Time: 43ms Amount: 0 bytes Throughput: 0.000 bytes/s
[INFO] Logged in - repository.hid.com
[INFO] Downloading: s3://repository.hid.com/release/org/slf4j/slf4j-parent/1.7.6/slf4j-parent-1.7.6.pom
[INFO] Logged off - repository.hid.com
[INFO] Transfers: 1 Time: 41ms Amount: 0 bytes Throughput: 0.000 bytes/s
[INFO] Logged in - repository.hid.com
[INFO] Downloading: s3://repository.hid.com/release/com/jcraft/jsch/0.1.42/jsch-0.1.42.pom
[INFO] Logged off - repository.hid.com
在settings.xml
中,此存储库配置为
<server>
<id>repository.hid.com</id>
<username>usr</username>
<password>pwd</password>
</server>
然后在pom.xml
:
<repository>
<id>repository.hid.com</id>
<url>s3://repository.hid.com/release</url>
</repository>
是否可以删除Logged in
和Logged off
消息,或者至少为每个工件只建立一个连接?
答案 0 :(得分:1)
You need to find out the logger name and then set the logger to error
Find the logger instance
In the file <MAVEN_HOME>/conf/logging/simplelogger.properties
.
Change org.slf4j.simpleLogger.showLogName=true
Find the logger which logs Logged in
and Logged off
disable info logs for the logger instance
If logger instance is org.apache.maven.x.y.z
then set org.slf4j.simpleLogger.log.org.apache.maven.x.y.z = error
this should not log info logs for that logger instance