简体   繁体   中英

Deploy a single war to multiple tomcats using tomcat-maven-plugin

I'm trying to deploy a single war project to multiple tomcats using mvn tomcat:deploy . Since these are listener project (aka workers), their overlapping names are irrelevant. When I have

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <configuration>
        <url>`http://192.168.116.54:8080/`manager/text</url>
        <server>standaardTomcat</server>
        <path>/picalcworker</path>
    </configuration>
</plugin>

a single war will be deployed on that server. Though I cannot have multiple 'plugins' of the same groupId artifactId combination, so simply copy this and change the url will result in a warning and only one (the latest) to be deployed.
This plugin further seems to allow:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <version>1.1</version>
    <executions>
        <execution>
        <id>1</id>
        <phase>deploy</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
            <configuration>
                <url>http://192.168.116.52:8080/manager/text</url>
                <server>standaardTomcat</server>
                <path>/picalcworker</path>
            </configuration>
        </execution>
        <execution>
        <id>2</id>
        <phase>deploy</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
            <configuration>
                <url>http://192.168.116.53:8080/manager/text</url>
                <server>standaardTomcat</server>
                <path>/picalcworker</path>
            </configuration>
        </execution>
    </executions>
</plugin>

but then mvn tomcat:deploy will try to deploy to localhost , since <configuration><url> was empty in this plugin's root (but I cannot supply a singular url there, since I need multiple). Also possible tomcat7 and tomcat6. I really like the deploy and undeploy options. Does anybody know how to make this work, or some reasonable alternative?

currently not possible. Note the plugin is now hosted at Apache see http://tomcat.apache.org/maven-plugin.html . Can you load a jira for that ? That need a bit of code (maybe you can add a patch :-) )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM