jenkins持续集成部署-踩过的坑(jenkins+svn/git+maven+tomcat)

1:构建触发器时选择轮训SCM,并且要勾选 《忽略钩子 post-commit》,否则不进行轮询。

2:tomcat的conf下tomcat-users.xml配置管理员账号密码

<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<user username="admin" password="xxxx" roles="manager-gui,manager-script,manager-jmx"/>

3:tomcat的webapps下host-manager和manager配置context.xml允许访问的IP

4:构建时选择配置好的maven项

并使用命令:clean install cargo:redeploy

要保证tomcat服务是启动的

5:maven项目的pom.xml配置plugin-cargo

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.4.15</version>
    <configuration>
        <container>
            <containerId>tomcat8x</containerId>
            <type>remote</type>
        </container>
        <configuration>
            <type>runtime</type>
            <properties>
           <cargo.tomcat.manager.url>http://ip:8080/manager</cargo.tomcat.manager.url>
                <cargo.remote.username>admin</cargo.remote.username>
                <cargo.remote.password>xxxx</cargo.remote.password>
                <cargo.servlet.port>8080</cargo.servlet.port>
                <cargo.hostname>ip</cargo.hostname>
                <cargo.tomcat.ajp.port>8009</cargo.tomcat.ajp.port>
            </properties>
        </configuration>
    </configuration>
</plugin>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值