简体   繁体   English

如何抑制Maven“无法找到资源”消息?

[英]How to suppress Maven “Unable to find resource” messages?

How can I tell Maven to suppress the "Unable to find resource" INFO messages for repositories in which it cannot find a dependency, but display those where it does find the dependency? 我如何告诉Maven对无法在其中找到依赖项的存储库抑制“无法找到资源” INFO消息,但显示那些确实找到依赖项的存储库呢? That is, display the hits, but omit the misses since these drown out and obscure the hits. 也就是说,显示匹配,但忽略未命中,因为这些淹没并掩盖了匹配。

For example, instead of this output: 例如,代替此输出:

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

I would like Maven to simply output the following: 我希望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之类的进程,以删除每个模式的行。

您是否尝试过更改settings.xml文件中的代理设置?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM