1
votes

I have looked through other related questions on Stack Overflow and cannot find anything that answers my question - please let me know if I have missed something...

I am using the Maven Tomcat Plugin to deploy applications to my local Tomcat 7.0 server. The default manager URL for the Maven Tomcat Plugin is:

http://localhost:8080/manager

On my Tomcat installation the manager (script) URL is:

http://localhost:8080/manager/text

This is the default - maybe this was changed in Tomcat 7.0? Anyway, the correct URL can easily be configured in the pom.xml for the relevant project:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <configuration>
        <url>http://localhost:8080/manager/text</url>
    </configuration>
</plugin>

My question is: can this be configured in Maven settings rather on a project-by-project basis? This seems like an environment-specific setting and not something I would necessarily want to include in the POM?

Thanks James

1

1 Answers

2
votes

Note the tomcat plugin is now hosted at Apache see http://tomcat.apache.org/maven-plugin-2.0-beta-1/

To support both tc6/7 there is now two plugin tomcat6 and tomcat7.

The best is to use a property:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <configuration>
      <url>${tomcatManagerUrl}</url>
    </configuration>
</plugin>

As it this can be defined in settings.xml and/or override -DtomcatManagerUrl=

-- Olivier