mvn clean tomcat:run command

When I run "mvn clean tomcat:run" (without specifying any tomcat version) command from command prompt for running my web application, it download tomcat 6.0.29 version dependency as shown below:

org/apache/tomcat/juli/6.0.29/juli-6.0.29.pom

org/apache/tomcat/annotations-api/6.0.29/annotations-api-6.0.29.pom

org/apache/tomcat/catalina-ha/6.0.29/catalina-ha-6.0.29.pom

org/apache/tomcat/coyote/6.0.29/coyote-6.0.29.pom

org/apache/tomcat/tribes/6.0.29/tribes-6.0.29.pom

org/apache/tomcat/jasper-el/6.0.29/jasper-el-6.0.29.pom

org/apache/tomcat/dbcp/6.0.29/dbcp-6.0.29.pom

pom.xml file of the application does not contain any tomcat version it require to run

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.0.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
    </plugins>
    <finalName>esa</finalName>
</build>

So my query is how does it decide to download particular this tomcat version dependency.

Answers


Probably the default settings of the tomcat plugin you run.

Try running mvn tomcat:help -Ddetails to see what version of the plugin you use, and how it can be configured.

I think it is an earlier version of the plugin, and you can now use explicit versions, such as

mvn org.apache.tomcat.maven:tomcat6-maven-plugin:2.0:run
mvn org.apache.tomcat.maven:tomcat7-maven-plugin:2.0:run

(or the shorter form)


Seems, you are running the tomcat-maven-plugin from codehaus, whihc has tomcat 6.0.29 built-in. (Seems there was no activity since 2010.) You should try the tomcat7 plugin from apache.

Regards Tibor


In command line for maven use --debug option to get explanation of build process. For our case output looks like:

...[DEBUG] Resolving plugin prefix tomcat from [org.apache.maven.plugins, org.codehaus.mojo] ... [DEBUG] Resolved plugin version for org.codehaus.mojo:tomcat-maven-plugin to 1.1 from repository central (http://repo.maven.apache.org/maven2, releases)...

Actually to explain why we've got tomcat v1.1 without specifying anything about tomcat, remember that maven build process has been customized with build plugins. And each build plugins has own build plugins. So it is enough to examine effective pom file to get clear understanding that almost empty initial pom.xml has quite big effective pom.xml.

To overcome issue just use explicit version of the tomcat plugin.


Need Your Help

apache ProxyPass: how to preserve original IP address

apache redirect proxypass

We are using ProxyPass to redirect all "/r" requests to jboss on port 18080 as follows:

drawString prints string over a screenshot of my current window

java swing jframe paint

When I run this code in Eclipse I get a the string and line printing in a new windows, but instead of a blank window it simply is a screenshot of my current window, set to the size I declare.