title: Deploying a Maven Project in Tomcat
body: <p>I have a problem when I wan't to deploy my maven project with tomcat. I only get a 404.
  When I try it with jetty it works fine.</p>
  
  <p>I think there is something wrong with the pom.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.shoot.tail&lt;/groupId&gt;
  &lt;artifactId&gt;shootout&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;1.2&lt;/version&gt;
  &lt;name&gt;Shootout&lt;/name&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;java.net&lt;/id&gt;
          &lt;url&gt;https://maven.java.net/content/repositories/releases&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  
  &lt;properties&gt;
      &lt;myfaces.version&gt;2.1.8&lt;/myfaces.version&gt;
      &lt;mojarra.version&gt;2.1.11&lt;/mojarra.version&gt;
      &lt;jetty.version&gt;8.1.5.v20120716&lt;/jetty.version&gt;
      &lt;tomcat.version&gt;7.0.12&lt;/tomcat.version&gt;
  &lt;/properties&gt;
  
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;mojarra&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
                  &lt;artifactId&gt;jsf-api&lt;/artifactId&gt;
                  &lt;version&gt;${mojarra.version}&lt;/version&gt;
                  &lt;scope&gt;compile&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
                  &lt;artifactId&gt;jsf-impl&lt;/artifactId&gt;
                  &lt;version&gt;${mojarra.version}&lt;/version&gt;
                  &lt;scope&gt;compile&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
                  &lt;artifactId&gt;jdbc-pool&lt;/artifactId&gt;
                  &lt;version&gt;${jdbc-pool.version}&lt;/version&gt;
                  &lt;scope&gt;system&lt;/scope&gt;
                  &lt;systemPath&gt;${basedir}/../${web.project}/WebContent/WEB-INF/lib/tomcat-jdbc.jar&lt;/systemPath&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
                  &lt;artifactId&gt;juli&lt;/artifactId&gt;
                  &lt;version&gt;${tomcat.version}&lt;/version&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
          &lt;properties&gt;
              &lt;override-web-xml&gt;src/main/jetty/override-mojarra-web.xml&lt;/override-web-xml&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;myfaces&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.apache.myfaces.core&lt;/groupId&gt;
                  &lt;artifactId&gt;myfaces-api&lt;/artifactId&gt;
                  &lt;version&gt;${myfaces.version}&lt;/version&gt;
                  &lt;scope&gt;compile&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.apache.myfaces.core&lt;/groupId&gt;
                  &lt;artifactId&gt;myfaces-impl&lt;/artifactId&gt;
                  &lt;version&gt;${myfaces.version}&lt;/version&gt;
                  &lt;scope&gt;compile&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
          &lt;properties&gt;
              &lt;override-web-xml&gt;src/main/jetty/override-myfaces-web.xml&lt;/override-web-xml&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  
  &lt;!-- Project dependencies --&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.0&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;version&gt;1.2.14&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.geronimo.specs&lt;/groupId&gt;
          &lt;artifactId&gt;geronimo-servlet_3.0_spec&lt;/artifactId&gt;
          &lt;version&gt;1.0&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;finalName&gt;shootout&lt;/finalName&gt;
      &lt;defaultGoal&gt;install&lt;/defaultGoal&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${tomcat.version}&lt;/version&gt;
              &lt;configuration&gt;
                   &lt;webAppConfig&gt;
                      &lt;contextPath&gt;/${project.artifactId}&lt;/contextPath&gt;
                      &lt;overrideDescriptor&gt;${override-web-xml}&lt;/overrideDescriptor&gt;
                  &lt;/webAppConfig&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
              &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${jetty.version}&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;webAppConfig&gt;
                      &lt;contextPath&gt;/${project.artifactId}&lt;/contextPath&gt;
                      &lt;overrideDescriptor&gt;${override-web-xml}&lt;/overrideDescriptor&gt;
                  &lt;/webAppConfig&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
      &lt;pluginManagement&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;configuration&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                      &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.9&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;wtpversion&gt;2.0&lt;/wtpversion&gt;
                      &lt;downloadSources&gt;true&lt;/downloadSources&gt;
                      &lt;additionalProjectFacets&gt;
                          &lt;jst.jsf&gt;2.0&lt;/jst.jsf&gt;
                      &lt;/additionalProjectFacets&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
                &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
                &lt;version&gt;2.1&lt;/version&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
  &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Version
  Eclipse: Juno
  Tomcat: 7.0.12
  Maven: 3.0.5</p>
  
  <p>And the error:</p>
  
  <pre><code>    [ERROR] Plugin org.codehaus.mojo:tomcat-maven-plugin:7.0.12 or one of its depend
  encies could not be resolved: Failed to read artifact descriptor for org.codehau
  s.mojo:tomcat-maven-plugin:jar:7.0.12: Failure to find org.codehaus.mojo:tomcat-
  maven-plugin:pom:7.0.12 in http://repo.maven.apache.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 -&gt; [Help 1]
  org.apache.maven.plugin.PluginResolutionException: Plugin org.codehaus.mojo:tomc
  at-maven-plugin:7.0.12 or one of its dependencies could not be resolved: Failed
  to read artifact descriptor for org.codehaus.mojo:tomcat-maven-plugin:jar:7.0.12
  
          at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re
  solve(DefaultPluginDependenciesResolver.java:129)
          at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginD
  escriptor(DefaultMavenPluginManager.java:142)
          at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDes
  criptor(DefaultMavenPluginManager.java:261)
          at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(D
  efaultBuildPluginManager.java:185)
          at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDesc
  riptor(MojoDescriptorCreator.java:235)
          at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalcul
  ator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
          at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalcul
  ator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
  eStarter.java:98)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
  java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
  sorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:601)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
  cher.java:290)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
  a:230)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
  uncher.java:409)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
  352)
  Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to
   read artifact descriptor for org.codehaus.mojo:tomcat-maven-plugin:jar:7.0.12
          at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
  loadPom(DefaultArtifactDescriptorReader.java:296)
          at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
  readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
          at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifac
  tDescriptor(DefaultRepositorySystem.java:279)
          at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re
  solve(DefaultPluginDependenciesResolver.java:115)
          ... 20 more
  Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure t
  o find org.codehaus.mojo:tomcat-maven-plugin:pom:7.0.12 in http://repo.maven.apa
  che.org/maven2 was cached in the local repository, resolution will not be reatte
  mpted until the update interval of central has elapsed or updates are forced
          at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
  aultArtifactResolver.java:538)
          at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
  facts(DefaultArtifactResolver.java:216)
          at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
  fact(DefaultArtifactResolver.java:193)
          at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
  loadPom(DefaultArtifactDescriptorReader.java:281)
          ... 23 more
  Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to fi
  nd org.codehaus.mojo:tomcat-maven-plugin:pom:7.0.12 in http://repo.maven.apache.
  org/maven2 was cached in the local repository, resolution will not be reattempte
  d until the update interval of central has elapsed or updates are forced
          at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.newExcept
  ion(DefaultUpdateCheckManager.java:230)
          at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArti
  fact(DefaultUpdateCheckManager.java:204)
          at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
  aultArtifactResolver.java:427)
          ... 26 more
  [ERROR]
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please rea
  d the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
  onException
  </code></pre>
  
  <p>Thanks a lot for your help.
  Best wishes
  Robert</p>