为不同的maven插件目标使用不同的配置

时间:2016-11-10 16:54:10

标签: maven tomcat7-maven-plugin

我见过maven plugins setting configurations与目标挂钩。我想用我的tomcat7-maven-plugin做到这一点。但是,这似乎不起作用;当我运行deploy时,它默认为localhost。这个插件不接受不同的配置,还是我做错了什么?

<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 个答案:

没有答案