我总是从http://mvnrepository.com获得我的依赖关系。每次都起作用。但我似乎不能让wss4j工作。我的战俘是这样的:
<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/
发布于 2015-10-10 19:01:15
不,它不在那里:您在pom中声明的工件没有<type>。即:默认情况下,Maven采用jar类型。看看你发布的网址,你就会意识到没有.jar神器。
当然您需要指定一个type=pom。
发布于 2015-10-12 08:51:12
从WSS4J 2.x开始,org.apache.wss4j/wss4j模块仅用作网站生成的一部分。您可能需要的依赖项是org.apache.wss4j/wss4jws-security-dom。
科姆。
https://stackoverflow.com/questions/33057607
复制相似问题