Gradle and java.jms

less than 1 minute read

I spent the better part of a day trying to track down this error:

* What went wrong: 
Could not resolve all dependencies for configuration ':compile'.
>Artifact 'javax.jms:jms:1.1@jar' not found.

After much searching I stumbled across this site that showed a bunch of excludes for a log4j dependency:

compile("log4j:log4j:1.2.15") {
            exclude group: "com.sun.jdmk", module: "jmxtools"
            exclude group: "com.sun.jmx", module: "jmxri"
            exclude group: "javax.mail", module: "mail"
            exclude group: "javax.jms", module: "jms"
        }

I have these jar files available for run time, but Gradle wasn’t letting me compile until log4j met its dependencies.