Running Tomcat Maven plugin with added project provided dependency
<p>Need to be pointed in the right direction on this perhaps, but if I add a "provided" dependency that is not included in the tomcat set of provided dependencies, running <code>tomcat7:run</code> from within eclipse fails with a <code>classnotfoundexception</code> on the class from the provided scope jar. </p>

<p>It needs to "provided" because it's a custom jar from a separate project that I've run mvn install on and for production am copying the jar to the $CATALINA_BASE/shared directory so that it's available (as a singleton) across applications/webapps. </p>

<pre><code>    &lt;dependency&gt;
        &lt;groupId&gt;IndexFileAccessTracker&lt;/groupId&gt;
        &lt;artifactId&gt;IndexFileAccessTracker&lt;/artifactId&gt;
        &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
</code></pre>

<p>Only way I see (with my limited knowledge of Maven and the Tomcat7 plugin) is to change the scope to <code>compile</code> when running tomcat from the plugin in Eclipse and then change the scope back to <code>provided</code> when running the <code>package</code> goal.</p>

<p>Are there solutions to this? I tried adding the dependency to the the tomcat maven plugin (keeping the main maven dependency as <code>provided</code> but got the same class not found error:</p>

<pre><code>            &lt;!-- For Maven Tomcat 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.2&lt;/version&gt;
            &lt;configuration&gt;
                &lt;path&gt;/CounterWebApp&lt;/path&gt;
            &lt;/configuration&gt;
            &lt;dependencies&gt;
                &lt;dependency&gt;
                    &lt;groupId&gt;IndexFileAccessTracker&lt;/groupId&gt;
                    &lt;artifactId&gt;IndexFileAccessTracker&lt;/artifactId&gt;
                    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
                    &lt;scope&gt;compile&lt;/scope&gt;
                &lt;/dependency&gt;
            &lt;/dependencies&gt;
        &lt;/plugin&gt;
</code></pre>

<p>Again, it needs to be <code>provided</code> in the main Maven dependency because I don't want it included in the deployed WAR.</p>