title: Unable to import classes from maven dependency of dynamic web project in eclipse
body: <p>I converted a dynamic web project into a maven project by right-clicking on the project and choosing Configure -> Convert to Maven Project. I added below dependency jar in pom.xml. </p>
  
  <pre><code>&lt;dependency&gt;
              &lt;groupId&gt;io.rest-assured&lt;/groupId&gt;
              &lt;artifactId&gt;rest-assured&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>Then,  right clicked project -> Run as -> maven install. The installation was successful.</p>
  
  <p>Now all the jars and classes are available under the Maven Dependencies section.
  Below is screenshot of my project structure.</p>
  
  <p><a href="https://i.stack.imgur.com/CV4df.png" rel="nofollow noreferrer">Project structure</a></p>
  
  <p>Below is the screenshot of maven dependency section.</p>
  
  <p><a href="https://i.stack.imgur.com/Q24w3.png" rel="nofollow noreferrer">Maven dependencies section</a></p>
  
  <p>However, I am unable to import any package or class form the dependency jars into any of my Java class (Ex: HttpServices.java) in src folder. I am unable to use the jars although they are downloaded.</p>
  
  <p>I tried updating Maven project (Force clearing snapshots), clean project, build project but nothing worked. I have no errors in the project. Also, when I added the jars directly into the build path (using add external jars i.e without maven) it worked perfectly fine. Please help in resolving the problem.</p>
  
  <p>Note: Other Java-maven projects are working fine. Problem is only with this converted maven project.
  I am using Eclipse Java EE IDE for Web Developers. Version: Photon Release (4.8.0) and jdk 8</p>
  
  <p>Below is the generated pom.xml. Compiler and war plugins were automatically generated when I converted the project to maven. I only added the dependency. </p>
  
  <pre><code>&lt;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"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;executeAutomation&lt;/groupId&gt;
    &lt;artifactId&gt;executeAutomation&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.7.0&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.8&lt;/source&gt;
            &lt;target&gt;1.8&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.2.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.rest-assured&lt;/groupId&gt;
              &lt;artifactId&gt;rest-assured&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Below is the class path entry for maven.</p>
  
  <pre><code>&lt;classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"&gt;
          &lt;attributes&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
              &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
  </code></pre>