Search code examples
javaeclipsemavenwss4j

Why can't I get the wss4j maven dependency in eclipse?


I have always gotten my dependencies from http://mvnrepository.com. Has worked every time. But I can't seem to get wss4j working. My POM is like this:

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

I can get the Spring just fine, but I keep getting the "Can't find dependency" error. I even use the -U option and I get this:

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]

But there is is downloading!!! What am I doing wrong?

UPDATE:
I used the -e option and I see that it can't find the 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)

but it is clearly there: http://repo1.maven.org/maven2/org/apache/wss4j/wss4j/2.1.3/


Solution

  • No, it isn't there: The artifact you declared in your pom has no <type>. i.e.: by default, Maven assumes a jar type. Look in URL you posted and realise there is no .jar artifact.

    Surely you need to specify a type=pom.