title: Maven servlet compile "All classes are up to date"
body: <p>I'm new to maven and servlets but I'm absolutely at my wits end. It refuses to work at every single twist and turn and for some reason it says "Nothing to compile - all classes are up to date" eventhough I've changed everything there is to change.</p>
  
  <p>This is my servlet:</p>
  
  <pre><code>@WebServlet("/HelloWorld")
  public class HelloWorldServlet extends HttpServlet {
  
  @Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
      response.setContentType("text/html");
      response.setCharacterEncoding("UTF-8");
  
      String hold = request.getParameter("text");
  
      try(PrintWriter out = response.getWriter()) {
          out.println("&lt;!DOCTYPE html&gt;");
          out.println("&lt;html&gt;");
          out.println("&lt;body&gt;");
          out.println("&lt;p&gt;"+hold+"&lt;/p&gt;");
          out.println("&lt;/body&gt;");
          out.println("&lt;/html&gt;");
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This is my pom.xml:</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;pxl.kits&lt;/groupId&gt;
    &lt;artifactId&gt;Webcomponents&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;  
  
    &lt;properties&gt;
      &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
      &lt;project.build.sourceEncoding&gt;
      UTF-8
      &lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
    &lt;build&gt;
        &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.0&lt;/version&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.cargo&lt;/groupId&gt;
              &lt;artifactId&gt;cargo-maven2-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.4.12&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;container&gt;
                  &lt;containerId&gt;tomcat8x&lt;/containerId&gt;
                  &lt;type&gt;installed&lt;/type&gt;
                  &lt;home&gt;${env.TOMCAT_HOME}&lt;/home&gt;
                  &lt;/container&gt;
                  &lt;configuration&gt;
                      &lt;type&gt;existing&lt;/type&gt;
                  &lt;home&gt;${env.TOMCAT_HOME}&lt;/home&gt;
                  &lt;/configuration&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;       
        &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;javax&lt;/groupId&gt;
      &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt;
      &lt;version&gt;7.0&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>And the command I use to run/debug:
      mvn package cargo:deploy</p>
  
  <p>Edit: </p>
  
  <pre><code>   [INFO] Scanning for projects...
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Webcomponents 0.0.1-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO]
      [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Webcomponents ---
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO]
      [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @Webcomponents -
  --
      [INFO] Nothing to compile - all classes are up to date
      [INFO]
      [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources)@Webcomponents ---
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 0 resource
      [INFO]
      [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @Webcomponents ---
      [INFO] Nothing to compile - all classes are up to date
      [INFO]
      [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ Webcomponents ---
      [INFO]
      [INFO] --- maven-war-plugin:2.2:war (default-war) @ Webcomponents ---
      [INFO] Packaging webapp
      [INFO] Assembling webapp [Webcomponents] in     [C:\Users\Laurens\workspace\Webcompo
  nents\target\Webcomponents-0.0.1-SNAPSHOT]
      [INFO] Processing war project
      [INFO] Copying webapp resources [C:\Users\Laurens\workspace\Webcomponents\src\ma
  in\webapp]
      [INFO] Webapp assembled in [41 msecs]
      [INFO] Building war: C:\Users\Laurens\workspace\Webcomponents\target\Webcomponen
  ts-0.0.1-SNAPSHOT.war
      [INFO] WEB-INF\web.xml already added, skipping
      [INFO]
      [INFO] --- cargo-maven2-plugin:1.4.12:deploy (default-cli) @ Webcomponents ---
      [INFO] [edDeployerDeployMojo] Resolved container artifact org.codehaus.cargo:car
  go-core-container-tomcat:jar:1.4.12 for container tomcat8x
      [INFO] [stalledLocalDeployer] Deploying [C:\Users\Laurens\workspace\Webcomponent
  s\target\Webcomponents-0.0.1-SNAPSHOT.war] to [C:\apache-tomcat-8.0.35/webapps].
  ..
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 3.063 s
      [INFO] Finished at: 2016-06-01T16:15:00+02:00
      [INFO] Final Memory: 12M/200M
      [INFO] ------------------------------------------------------------------------
  </code></pre>