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

后端 未结 9 1463
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 06:52

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\

相关标签:
9条回答
  • 2020-12-05 06:56
       <dependency>
          <groupId>javax</groupId>
          <artifactId>javaee-api</artifactId>
          <version>6.0</version>
          <scope>provided</scope>
        </dependency>
    
    0 讨论(0)
  • 2020-12-05 06:57

    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.

    0 讨论(0)
  • 2020-12-05 07:01

    This worked for myself

        <dependency>
            <groupId>javax.jms</groupId>
            <artifactId>javax.jms-api</artifactId>
            <version>2.0.1</version>
        </dependency>
    
    0 讨论(0)
  • 2020-12-05 07:05

    If you just want the JMS libs, without the rest of javaee, use the following:

    https://mvnrepository.com/artifact/javax.jms/javax.jms-api/2.0.1

    <dependency>
        <groupId>javax.jms</groupId>
        <artifactId>javax.jms-api</artifactId>
        <version>2.0.1</version>
    </dependency>
    
    0 讨论(0)
  • 2020-12-05 07:07

    Go to Maven Search site and search for javax. Open the latest version for groupId javax and artifactId javaee-api

    The current version is 7.0 [Maven dependency information]

    0 讨论(0)
  • 2020-12-05 07:14

    According to mvnrepository, the dependency to add in the pom of your project is the following:

    <dependency>
      <groupId>jms</groupId>
      <artifactId>jms</artifactId>
      <version>1.1</version>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题