programing tip

다음 아티팩트를 해결할 수 없습니다. javax.jms : jms : jar : 1.1

itbloger 2020. 10. 16. 07:14
반응형

다음 아티팩트를 해결할 수 없습니다. javax.jms : jms : jar : 1.1


Maven 프로젝트를 컴파일하려고하는데 체계적으로 다음과 같은 오류 메시지가 나타납니다.

[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]

나는 Sun jars에 대한 이 maven 게시물에 대해 알고 있지만 문제를 해결하지 못합니다.

누구에게 해결책이 있습니까? 내 pom.xml에 지정할 수있는 저장소가 있습니까?

감사!


제안 해 주셔서 감사합니다. 나는 마지막으로 읽은 후이 문제에 대한 해결책을 발견 . 이러한 종속성은 ZooKeeper에 대한 종속성에서 비롯된 것으로 나타났습니다.

내 pom.xml을 다음과 같이 수정했고 문제가 해결되었습니다.

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

누군가 여전히 jms1.1을 사용하고 싶다면 공개 jboss 저장소를 추가하면 maven이 찾을 것입니다.

프로젝트-> 종속성 :

  <dependencies>
    <dependency>
      <groupId>javax.jms</groupId>
      <artifactId>jms</artifactId>
      <version>1.1</version>
    </dependency>

프로젝트-> 저장소 :

  <repositories>
    <repository>
      <id>repository.jboss.org-public</id>
      <name>JBoss.org Maven repository</name>
      <url>https://repository.jboss.org/nexus/content/groups/public</url>
    </repository>  

효과가있다 -

F:\mvn-repo-stuff>mvn verify
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mvn-repo-stuff 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/javax/jms/jms/1.1/jms-1.1.pom
Downloaded: http://repo1.maven.org/maven2/javax/jms/jms/1.1/jms-1.1.pom (677 B at 0.8 KB/sec)
[WARNING] The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to xml-apis:xml-apis:jar:1.0.b2
Downloading: http://repo1.maven.org/maven2/javax/jms/jms/1.1/jms-1.1.jar
Downloading: https://repository.jboss.org/nexus/content/groups/public/javax/jms/jms/1.1/jms-1.1.jar
Downloaded: https://repository.jboss.org/nexus/content/groups/public/javax/jms/jms/1.1/jms-1.1.jar (26 KB at 8.5 KB/sec)

Log4 version 1.2.17 automatically resolves the issue as it has depency on geronimo-jms. I got the same issue with log4j- 1.2.15 version.


Added with more around the issue


using 1.2.17 resolved the issue during the compile time but the server(Karaf) was using 1.2.15 version thus creating conflict at run time. Thus I had to switch back to 1.2.15.

The JMS and JMX api were available for me at the runtime thus i did not import the J2ee api.

what i did was I used the compile time dependency on 1.2.17 but removed it at the runtime.

            <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
....
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                                                          <Import-Package>!org.apache.log4j.*,*</Import-Package>

.....

Another solution if you don't want to modify your settings:

Download jms-1.1.jar from JBoss repository then:

mvn install:install-file -DgroupId=javax.jms -DartifactId=jms -Dversion=1.1 -Dpackaging=jar -Dfile=jms-1.1.jar


Try forcing updates using the mvn cpu option:

usage: mvn [options] [<goal(s)>] [<phase(s)>]

Options:
 -cpu,--check-plugin-updates            Force upToDate check for any
                                        relevant registered plugins

In fact the real solution for this issue is to use the jms-api-1.1-rev-1.jar artifact available on Maven Central : http://search.maven.org/#artifactdetails%7Cjavax.jms%7Cjms-api%7C1.1-rev-1%7Cjar


A check of ibliblio and java.net repositories reveal that jmx related jar is not present in either. I think you should manually download jms and install them locally as discussed here.


I also faced the same issue when I started using following maven dependency version for log4j (1.2.15) in my project.

<dependency>
  <groupId>log4j</groupId>
  <artifactId>log4j</artifactId>
  <version>1.2.15</version>
</dependency>

Following error was thrown at me.

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: Could not transfer artifact javax.jms:jms:jar:1.1 from/to java.net (https://maven-repository.dev.java.net/nonav/repository): Cannot access https://maven-repository.dev.java.net/nonav/repository with type legacy using the available connector factories: BasicRepositoryConnectorFactory: Cannot access https://maven-repository.dev.java.net/nonav/repository with type legacy using the available layout factories: Maven2RepositoryLayoutFactory: Unsupported repository layout legacy -> [Help 1]

I started using following log4j (1.2.17) version and it helped me solve this issue without any configurations related fixes.

 <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.17</version>
    </dependency>

You import one dependency, and this dependency is dependent on com.sun.jmx:jmxri:jar:1.2.1 and others, but com.sun.jmx:jmxri:jar:1.2.1 cannot be found in central repository,

so you'd better try to import another version.

Here suppose your dependency may be log4j, and you can try to import log4j:log4j:jar:1.2.13.


May not be the exactly same problem. but there is a nice article on the same line Here

참고URL : https://stackoverflow.com/questions/4908651/the-following-artifacts-could-not-be-resolved-javax-jmsjmsjar1-1

반응형