周末没事看看持续集成的一些基本框架,做了个简单的demo,在此记录一下,以便以后查阅。
jekins 在系统配置里面配 jdk,maven环境,还要装个deploy的插件,然后新建一个任务,按照提示一步一步来就好,自动发部用的是maven的功能,有maven的客户端也能发部到tomcat容器中
pom.xml
<build>
<directory>target</directory><!-- 这是打包的文件的路径。默认是该工程的根目录。 -->
<finalName>testMaven</finalName>
<defaultGoal>tomcat7:deploy</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<url>http://192.168.126.129:8080/manager/text</url>
<username>tomcat</username>
<password>tomcat</password>
<path>/test</path>
</configuration>
</plugin>
</plugins>
</build>
tomcat里在conf/tomcat-users.xml 里加上
<role rolename="manager-gui"/> >
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="tomcat" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status"/>