如何告诉 Maven 对于无法找到依赖项的存储库抑制“无法找到资源”INFO 消息,但显示那些它确实找到依赖项的存储库?也就是说,显示命中,但忽略未命中,因为它们淹没并掩盖了命中。
例如,代替此输出:
Downloading: http://download.java.net/maven/2/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.pom
[INFO] Unable to find resource 'org.slf4j:slf4j-api:pom:1.5.8' in repository maven.java.net (http://download.java.net/maven/2)
Downloading: http://www.ibiblio.org/maven/mule/dependencies/maven2/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.pom
[INFO] Unable to find resource 'org.slf4j:slf4j-api:pom:1.5.8' in repository com.springsource.repository.bundles.release (http://w
ww.ibiblio.org/maven/mule/dependencies/maven2)
Downloading: http://repository.springsource.com/maven/bundles/external/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.pom
[INFO] Unable to find resource 'org.slf4j:slf4j-api:pom:1.5.8' in repository com.springsource.repository.bundles.external (http://
repository.springsource.com/maven/bundles/external)
Downloading: http://repository.jboss.com/maven2/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.pom
我希望 Maven 简单地输出以下内容:
Downloading: http://repository.jboss.com/maven2/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.pom
2K downloaded (slf4j-api-1.5.8.pom)
最佳答案
我不知道在 Maven 内部要做什么,但您始终可以将输出通过管道传输到 grep 或 sed 等进程,以删除每个模式的行。
关于java - 如何抑制 Maven "Unable to find resource"消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2878309/