Maven must be losing its mind.
I added a dependency using Netbeans Add Dependency dialog. I searched for jax-rs-ri. It updated the index from central and showed several versions of jax-rs-ri. I selected 1.9.1 and it added this to the pom.xml:
<dependency>
<groupId>com.sun.jersey.ri</groupId>
<artifactId>jax-rs-ri</artifactId>
<version>1.9.1</version>
</dependency>
Looks right, but when I build I get the following error:
Failed to execute goal on project reply-to.test-web:
Could not resolve dependencies for project jms:reply-to.test-web:war:1.0-SNAPSHOT:
Could not find artifact com.sun.jersey.ri:jax-rs-ri:jar:1.10-b03 in
central (http://repo1.maven.org/maven2) -> [Help 1]
I’ve also tried changing the repository the following with the same results:
<repositories>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2</url>
<layout>default</layout>
</repository>
</repositories>
This was working earlier today. Did something just get broken with Maven?
In these cases it’s worth to check the local repository (usually
c:\Users\<username>\.m2\repository\com\sun\jersey\ri\jax-rs-rior/home/<username>/.m2/repository/com/sun/jersey/jax-rs-ri) and Central:http://search.maven.org/#artifactdetails|com.sun.jersey.ri|jax-rs-ri|1.9.1|pom
(The important part now is the “Available Downloads” table.)
So, there isn’t any
jarfile just azip(and the POM). You should use<type>zip</type>in your dependency like this:Since it’s a zip maybe you want to unpack it. This answer could help: Unzip dependency in maven
Please note that
1.9.1is not the latestjax-rs-riversion and your Maven uses1.10-b03. If you want to force it to use1.9.1you have to use<version>[1.9.1]</version>inside thedependencytag.