I'm new to gradle, but the build of the project I'm on has been working pretty much on its own for months. Today I try to "gradle" it and I get a rather mysterious error...
bobk-mbp:DM_Server bobk$ gradle
:clean
:readme
:compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Artifact 'org.apache.james:apache-mime4j:0.6@jar' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 7.114 secs
The thing is I don't have any explicit dependency on org.apache.james:apache-mime4j in my dependencies section, so it must be coming in on something else. How do I figure out which of my dependencies actually needs this and then, how do I overcome or work around this missing artifact?
Well that was fun. The gradle equivalent of maven's dependency:tree is
gradle dependencies
compile - Classpath for compiling the main sources.
+--- com.google.guava:guava:11.0.2 [default]
| \--- com.google.code.findbugs:jsr305:1.3.9 [compile,master,runtime]
...
+--- org.jboss.resteasy:resteasy-multipart-provider:2.3.0.GA [default]
| +--- javax.mail:mail:1.4.4 [compile,master,runtime]
| | \--- javax.activation:activation:1.1 [compile,master,runtime]
| +--- org.apache.james:apache-mime4j:0.6 [compile,master,runtime]
This revealed my james dependency is coming in via resteasy. This knowledge alone was not helpful. It seems that my local cache has gone bad. Nuking the local m2 cache (~/.m2) solved the problem (I started out rm -rf one package at a time, but that got old quickly).
rm -rf ~/.m2
Apparently there is much I need to learn about this infrastructure. I am sure there is a better way to do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With