What is the right Maven dependency for javax.jms.* classes?

yegor256 picture yegor256 · Jun 13, 2011 · Viewed 64.7k times · Source

I need to import javax.jms.* classes. What is the right dependency to include into a Maven project? I'm trying javax.jms:jms:1.1, but no luck (it's pom, not jar).

ps. The only workaround I've found so far is: javax:javaee-api:6.0 (from Maven Central).

Answer

Tim Bish picture Tim Bish · Jun 13, 2011

In ActiveMQ as well as some other projects like Qpid JMS we pull in the JMS spec classes from Apache Geronimo JARs, the 1.1 APIs are available in this dependency:

  <dependency>
    <groupId>org.apache.geronimo.specs</groupId>
    <artifactId>geronimo-jms_1.1_spec</artifactId>
    <version>1.1.1</version>
  </dependency>

For JMS 2 APIs you'd need to use a different dependency, for instance

  <dependency>
    <groupId>org.apache.geronimo.specs</groupId>
    <artifactId>geronimo-jms_2.0_spec</artifactId>
    <version>1.0-alpha-2</version>
  </dependency>

These are both Apache 2.0 licensed dependencies.