views:

311

answers:

1

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? 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:

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)
+1  A: 

I don't know what to do from inside maven, but you could always pipe the output to a process like grep or sed to remove the lines per pattern.

seanizer
True, but grep won't omit the lines which show the failed download attempts. That is, it won't hide line that precedes the "Unable to find resource" messages. This might be possible with a slightly more sophisticated sed, awk, or perl script, but I was hoping for a solution that would require less effort. I'm lazy.
Derek Mahar
grep -v reverses the match: http://unixhelp.ed.ac.uk/CGI/man-cgi?grep
seanizer
Though this isn't the ideal solution, it's probably the best approach available.
Derek Mahar