Similar questions have been posted here and here but the former proposes solutions only to NoSuchMethodError and the latter doesn't even mention ResteasyClientBuilder, which is precisely what causes my error whenever I try to call a get method from my client.
I'm using WildFly, Maven, RESTEasy/JBoss. I can successfully run my WildFly server using standalone in command prompt, and use maven to deploy a war file to the WildFly server, and use get methods in a browser/Postman to receive results. However if I try to call the exact same get method from within my client code, I get the error below. It is caused by ResteasyClientBuilder.
What is wrong? I have minimal dependencies and plugins in my pom and the server code works, but the client does not. My pom uses versions "3.0.19.Final" because that's the jar version for resteasy-jaxrs-3.0.19.Final.jar in C:\Users\ME\Documents\Wildfly\wildfly-10.1.0.Final\modules\system\layers\base\org\jboss\resteasy\resteasy-jaxrs\main
Error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/resteasy/client/jaxrs/ResteasyClientBuilder
    at com.sample.ClientDemo.main(ClientDemo.java:21)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.ClassNotFoundException: org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 6 more
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.sample</groupId>
    <artifactId>rest-demo</artifactId>
    <version>1.0.SNAPSHOT</version>
    <packaging>war</packaging>
    <name>rest-demo</name>
    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-client</artifactId>
            <version>3.0.19.Final</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <version>3.0.19.Final</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>1.1.0.Alpha11</version>
                <configuration>
                    <name>rest-demo.war</name>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
server code (HelloWorld.java)
import javax.ws.rs.*;
@Path("tutorial")
public class HelloWorld
{
    @GET
    @Path("helloname/{name}")
    public String hello(@PathParam("name") final String name) {
        return "Hello " +name;
    }
}
client code (ClientDemo.java)
import org.jboss.resteasy.client.jaxrs.ResteasyClient;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
import javax.ws.rs.core.Response;
public class ClientDemo {
    public static void main(String[] args) {
        ResteasyClient client = new ResteasyClientBuilder().build();  // <-- Error occurs here
        ResteasyWebTarget target = client.target("http://localhost:8080/rest-demo/rest/tutorial/helloname/john");
        Response response = target.request().get();
        String value = response.readEntity(String.class);
        response.close();
    }
}
Edit Configurations in IntelliJ
The error remains even after explicilty referencing the client jar. What is wrong?

 
     
     
     
    