The following artifacts could not be resolved: javax.jms:jms:jar:1.1

Jérôme Verstrynge picture Jérôme Verstrynge · Feb 5, 2011 · Viewed 127.9k times · Source

I am trying to compile a maven project, but I systematically get the following error message:

[ERROR]Failed to execute goal on project ...:
Could not resolve dependencies for project ...:war:1.0.0:
The following artifacts could not be resolved: javax.jms:jms:jar:1.1,
com.sun.jdmk:jmxtools:jar:1.2.1, com.sun.jmx:jmxri:jar:1.2.1:
Failure to find javax.jms:jms:jar:1.1 in http://mirrors.ibiblio.org/maven2/
  was cached in the local repository, resolution will not be reattempted until
  the update interval of maven2-repository.ibiblio.mirror has elapsed or
  updates are forced -> [Help 1]

I know about this maven post about Sun jars, but it does not solve the problem.

Is there a repository I can specify in my pom.xml?

Answer

Jérôme Verstrynge picture Jérôme Verstrynge · Feb 5, 2011

Thanks for the suggestions. I finally found a solution to this problem after reading this. It turns out that these dependencies were coming from a dependency to ZooKeeper.

I modified my pom.xml as following and it solved the problem:

    <dependency>
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper</artifactId>
        <version>3.3.2</version>
        <exclusions>
            <exclusion>
                <groupId>com.sun.jmx</groupId>
                <artifactId>jmxri</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jdmk</groupId>
                <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
                <groupId>javax.jms</groupId>
                <artifactId>jms</artifactId>
            </exclusion>
        </exclusions>
    </dependency>