Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

maven

jms

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).

like image 774
yegor256 Avatar asked Jun 13 '11 18:06

yegor256


People also ask

What is javax JMS?

Package javax. jms. The Java Message Service (JMS) API provides a common way for Java programs to create, send, receive and read an enterprise messaging system's messages.

What is Maven dependency in Java?

What is Maven Dependency? In Maven, a dependency is just another archive—JAR, ZIP, and so on—which our current project needs in order to compile, build, test, and/or run. These project dependencies are collectively specified in the pom. xml file, inside of a <dependencies> tag.

What is Connectionfactory in JMS?

A connection factory is an object that a JMS client (a JMS program that uses the JMS API) uses to create a connection with a JNDI provider (a messaging provider such as IBM® MQ).


1 Answers

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.

Another option which is not Apache licensed is here as others have pointed out.

<dependency>     <groupId>javax.jms</groupId>     <artifactId>javax.jms-api</artifactId>     <version>2.0.1</version> </dependency> 
like image 184
Tim Bish Avatar answered Sep 28 '22 04:09

Tim Bish