首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >无法解析以下工件: javax.jms:jms:jar:1.1

无法解析以下工件: javax.jms:jms:jar:1.1
EN

Stack Overflow用户
提问于 2011-02-06 02:13:03
回答 9查看 133.8K关注 0票数 79

我正在尝试编译一个maven项目,但系统地收到以下错误消息:

代码语言:javascript
复制
[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]

我知道this maven post about Sun jars,但它不能解决问题。

是否可以在我的pom.xml中指定存储库

EN

回答 9

Stack Overflow用户

回答已采纳

发布于 2011-02-06 03:06:08

谢谢你的建议。在阅读了this之后,我终于找到了解决这个问题的方法。事实证明,这些依赖项来自对ZooKeeper的依赖项。

我修改了我的pom.xml如下,它解决了这个问题:

代码语言:javascript
复制
    <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>
票数 83
EN

Stack Overflow用户

发布于 2011-03-11 20:03:12

如果任何人仍然想使用jms1.1,那么添加公共jboss存储库,maven会找到它……

项目->依赖项:

代码语言:javascript
复制
  <dependencies>
    <dependency>
      <groupId>javax.jms</groupId>
      <artifactId>jms</artifactId>
      <version>1.1</version>
    </dependency>

项目->存储库:

代码语言:javascript
复制
  <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>  

它起作用了-

代码语言:javascript
复制
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)
票数 66
EN

Stack Overflow用户

发布于 2012-02-20 17:42:28

如果你不想修改你的设置,另一个解决方案:

然后下载jms-1.1.jar from JBoss repository

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

票数 15
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4908651

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档