【问题标题】:Why can't I get the wss4j maven dependency in eclipse?为什么我无法在 Eclipse 中获取 wss4j maven 依赖项?
【发布时间】:2015-10-10 18:39:25
【问题描述】:

我总是从http://mvnrepository.com 获得我的依赖。每次都有工作。但我似乎无法让 wss4j 工作。我的 POM 是这样的:

<dependencies>
 <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>4.2.1.RELEASE</version>
 </dependency>
 <dependency>
    <groupId>org.apache.wss4j</groupId>
    <artifactId>wss4j</artifactId>
    <version>2.1.3</version>
 </dependency>
</dependencies>

我可以很好地获得 Spring,但我不断收到“找不到依赖项”错误。我什至使用 -U 选项,我得到了这个:

Downloading: http://repo1.maven.org/maven2/org/org/apache/wss4j/wss4j/2.1.3/wss4j-2.1.3.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/wss4j/wss4j/2.1.3/wss4j-2.1.3.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.411s
[INFO] Finished at: Sat Oct 10 14:31:51 EDT 2015
[INFO] Final Memory: 9M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project crypt.lib: Could not resolve dependencies for project mmaceachran:crypt.lib:jar:0.0.1-SNAPSHOT: Could not find artifact org.apache.wss4j:wss4j:jar:2.1.3 in mvnrepository (http://repo1.maven.org/maven2/org/) -> [Help 1]

但是有下载!!!我做错了什么?

更新:
我使用了 -e 选项,我发现它找不到工件:

Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact org.apache.wss4j:wss4j:jar:2.1.3 in central (https://repo.maven.apache.org/maven2)

但它显然存在:http://repo1.maven.org/maven2/org/apache/wss4j/wss4j/2.1.3/

【问题讨论】:

    标签: java eclipse maven wss4j


    【解决方案1】:

    从 WSS4J 2.x 开始,org.apache.wss4j/wss4j 模块仅用作网站生成的一部分。您可能想要的依赖项是 org.apache.wss4j/wss4j-ws-security-dom。

    科尔姆。

    【讨论】:

      【解决方案2】:

      不,它不存在:您在 pom 中声明的工件没有 &lt;type&gt;。即:默认情况下,Maven 假定为 jar 类型。查看您发布的 URL 并发现没有 .jar 工件。

      您当然需要指定 type=pom。

      【讨论】:

      • 那么他们应该把它放在对 MVNrepostiory 的依赖中,恕我直言。 -- 谢谢
      • @little-santi 你太棒了!你救了我一天!
      • 祝你有美好的一天,纳乔。 :-)
      猜你喜欢
      • 2020-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-03
      • 1970-01-01
      • 2014-12-31
      相关资源
      最近更新 更多