我总是从 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 选项,我发现它找不到 Artifact :
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/

最佳答案

不,它不存在:您在 pom 中声明的 Artifact 没有 <type> 。即:默认情况下,Maven 假定为 jar 类型。查看您发布的 URL 并意识到没有 .jar Artifact 。

当然,您需要指定 type=pom。

10-06 13:46