简体   繁体   中英

Deploy to $CATALINA_HOME using maven cargo plugin

I use cargo-maven2-plugin to deploy war files to a running remote tomcat container. Now I need to copy files to $CATALINA_HOME/myfolder . I do this using ant-run/scp/ssh .

But is it possible to do this with the cargo-maven2-plugin or does it only operate on the application/webapps level?

Try cargo with installed deployer and existing configuration

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.4.5</version>
    <configuration>
        <container>
            <containerId>tomcat7x</containerId>
            <home>${env.CATALINA_HOME}</home>
        </container>
        <configuration>
            <type>existing</type>
            <home>${env.CATALINA_HOME}</home>
        </configuration>
        <deployer>
            <type>installed</type>
        </deployer>
    </configuration>
</plugin>

My sample project works this way

$ mvn cargo:deploy

[INFO] --- cargo-maven2-plugin:1.4.5:deploy (default-cli) @ sample-war ---
[INFO] [edDeployerDeployMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-tomcat:jar:1.4.5 for container tomcat7x
[INFO] [stalledLocalDeployer] Deploying [/home/mariuszs/git/sample-war/target/sample.war] to [/opt/tomcat/webapps]...

You can check full sample project for this https://github.com/mariuszs/cargo-existing-installed-sample

Some links than can help:

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