java - 如何抑制 Maven "Unable to find resource"消息?

标签 java maven

如何告诉 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/

相关文章:

java - 如何使用分割字符串搜索并填充到 ListView

java - 如何从插件中读取 .m2/settings.xml 文件中的 Maven 设置

java - 使用 onejar-maven-plugin 构建可运行的 jar

java - 使用 Java 模式检查是否存在负面列表字符

java - 如何检查输入元素是否在表单元素内

c# - 如何通过静默提供用户凭据来打开共享点页面

java - mvn 任务失败时如何使 Ant 构建失败?

java - 源文件夹不属于 GWT 项目

java - 在我的 war 中在运行时获取 maven 部署插件 Artifact 版本

java - 匿名类方法访问