cargo实现自动化部署远程jetty容器(非安全模式)

cargo实现自动化部署应用至远程jetty容器

(非安全模式)

一、准备:

WAR包:Deployer Web application for the Jetty remote containers

下载地址:http://repo.maven.apache.org/maven2/org/codehaus/cargo/cargo-jetty-7-and-onwards-deployer/1.6.3/cargo-jetty-7-and-onwards-deployer-1.6.3.war

二、配置:

将上述下载好的war放至jetty目录下的webapps下

org.codehaus.cargo " v:shapes="文本框_x0020_2">Maven目录下的settings.xml文件添加cargo插件

<pluginGroups>
    <pluginGroup>org.codehaus.cargo</pluginGroup> 
</pluginGroups>

org.codehaus.cargo cargo-maven2-plugin 1.6.3 jetty9x remote runtime 192.168.1.220 8080 remote com.lxgm.lekang dubbo-web-user war /dubbo-web-user-1.0-SNAPSHOT " v:shapes="_x0000_s1026">Maven项目pom.xml文件中添加

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <version>1.6.3</version>
            <configuration>
                <!-- Container configuration -->
                <container>
                    <containerId>jetty9x</containerId>
                    <type>remote</type>
                </container>

                <!-- Configuration to use with the container (which will also configure the deployer) -->
                <configuration>
                    <type>runtime</type>
                    <properties>
                        <cargo.hostname>192.168.1.220</cargo.hostname>
                        <cargo.servlet.port>8080</cargo.servlet.port>
                    </properties>
                </configuration>

                <deployer>
                    <type>remote</type>
                </deployer>

                <deployables>
                    <deployable>
                        <groupId>com.lxgm.lekang</groupId>
                        <artifactId>dubbo-web-user</artifactId>
                        <type>war</type>
                        <properties>
<!—如下是配置war名字,如果更换会重新生成一个war-->
                            <context>/dubbo-web-user-1.0-SNAPSHOT</context>
                        </properties>
                    </deployable>
                </deployables>
            </configuration>
        </plugin>
    </plugins>
</build>

添加后,maven会自动下载cargo插件,下载完毕后如下图

 

三、Terminal窗口运行 mvn cargo:redeploy 执行重新发布应用

四、启动jetty,测试Deployer Web application for the Jetty remote containers

浏览器访问http://192.168.1.220:8080/cargo-jetty-deployer/

五、存在的问题

执行mvn cargo:redeploy 后,需要重启jetty服务器页面才能正常访问。

六、参考网址

https://codehaus-cargo.github.io/cargo/Downloads.html

https://codehaus-cargo.github.io/cargo/Jetty+Remote+Deployer.html

 

原文地址:https://www.cnblogs.com/luoxiaolei/p/7009299.html