I have a code that has a dependency on the RESTEasy JAX RS Client
I added it as a dependency to my project like this:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.8.Final</version>
</dependency>
I can write the code normally, but when I try to compile, I get these errors:
java: cannot access javax.ws.rs.client.ClientBuilder
class file for javax.ws.rs.client.ClientBuilder not found
java: cannot access javax.ws.rs.core.Link
class file for javax.ws.rs.core.Link not found
java: cannot access javax.ws.rs.client.WebTarget
class file for javax.ws.rs.client.WebTarget not found
Although I can find these classes normally, I know they are in my maven repo, and if I look them up using my IDE, I can access them, so I know they exist.
I tried changing the dependency scope to provided and compile just for the sake of testing it out, but with no luck.
Any idea what I might be missing?
EDIT
relevant pom.xml
<modelVersion>4.0.0</modelVersion>
<artifactId>my-project-id</artifactId>
<name>MyProject Name</name>
<dependencies>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.8.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
class failing to compile
import org.jboss.resteasy.client.jaxrs.ResteasyClient;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
import my.project.representations.App;
public class Main {
public static void main(String[] args) {
ResteasyClient client = new ResteasyClientBuilder().build();
ResteasyWebTarget target = client.target(SERVER_URL);
String token = "access_token";
target.register(new BearerTokenFilter(token));
Admin admin = target.proxy(Admin.class);
Realm realm = admin.realm("realm_name");
for (App app : realm.apps().findAll()) {
System.out.println(app.getName());
}
}
}
mvn clean installwhich showed the same problem.pomplease and one source failing source file please, if possible minimal failing example.