0

I am learing REST throught java using JBoss RestEasy. To use JAXB api implementation I given the following dependency in pom.xml, {I am using maven project in eclipse}

<dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jaxrs</artifactId>
        <version>2.3.1.GA</version>
</dependency>

But I am getting some set of build errors. But the below is the root cause of the errors I guess,

ArtifactDescriptorException: Failed to read artifact descriptor for javax.xml.stream:stax-api:jar:1.0-2: ArtifactResolutionException: Failure to transfer javax.xml.stream:stax-api:pom:1.0-2 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced.

Original error: Could not transfer artifact javax.xml.stream:stax-api:pom:1.0-2 from/to central (http://repo1.maven.org/maven2): null to http://repo1.maven.org/maven2/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.pom

By the above error I understand that it failed to transfer the stax-api depency file. I added the dependency for that stax-api later. But no use. Still getting the same error.

Is my perception of the above error correct? If so do I have to give the repository info for this file too in pom.xml? Then is it not contradicting the main advantage of Maven usage(auto download of dependency files)?

Please correct me if I were wrong

Below is my complete pom.xml,

<project xmlns="http://maven.apache.org/POM/4.0.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.droidaceapps.services</groupId>
    <artifactId>RestServicesProject</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
   <name>RestServicesProject Maven Webapp</name>
   <url>http://maven.apache.org</url>
 <repositories>
   <repository>
    <id>jboss</id>
    <url>https://repository.jboss.org/nexus/content/groups/public</url>
    </repository>
 </repositories>       
 <dependencies>
<dependency>    
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jaxrs</artifactId>
        <version>2.3.1.GA</version>
</dependency>           
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.1</version>
  <scope>test</scope>
</dependency>
   <dependency>
  <groupId>org.jboss.resteasy</groupId>
  <artifactId>resteasy-jaxb-provider</artifactId>
  <version>2.3.1.GA</version>
 </dependency>    
</dependencies>
<build>
 <finalName>RestServicesProject</finalName>
</build>
 </project>

Thanks

droidsites
  • 1,035
  • 4
  • 16
  • 29

2 Answers2

1

Hurrah...I solved this. I did execute the MVN from command line .. it just worked. Then I went back to eclipse and refreshed the project then all the bugs gone and all dependancies are in place.

seems there is a problem with the m2eclipse plugin (whichi I conculde as root cause of the bug.. :-)

droidsites
  • 1,035
  • 4
  • 16
  • 29
-1

i solved this problem....not using maven.......just by creating a Dynamic web project...with jboss server..with web.xml

and then...go to source > new >other >web service > create a sample restful web serivce

click to update the web.xml......and it support jboss in eclipse

jaskirat Singh
  • 696
  • 1
  • 8
  • 17