use different configurations for different maven plugin goals

86 Views Asked by At

I've seen maven plugins setting configurations tied to goals. I'd like to do that with my tomcat7-maven-plugin. However, this doesn't seem to work; when I run deploy it's defaulting to localhost. Does this plugin not accept different configs or am I doing something wrong?

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
    <executions>
        <execution>
            <id>deploy</id>
            <goals>
                <goal>deploy</goal>
                <goal>redeploy</goal>
            </goals>
            <configuration>
                <url>${tomcat-manager-url}/manager/text</url>
                <username>${tomcat-manager-username}</username>
                <password>${tomcat-manager-password}</password>
                <path>/${project.artifactId}1</path>
            </configuration>
        </execution>
        <execution>
            <id>run</id>
            <goals>
                <goal>run</goal>
            </goals>
            <configuration>
                <path>/</path>
            </configuration>
        </execution>
    </executions>
</plugin>
0

There are 0 best solutions below