`
kidiaoer
  • 浏览: 821932 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

持续集成实践

阅读更多
 
CC的项目配置:
Xml代码

   1. <strong><strong><strong><cruisecontrol>  
   2.    <project requiremodification="false" forceonly="false" name="MavenBasedCI">  
   3.     <modificationset QuietPeriod="30">  
   4.       <svn LocalWorkingCopy="${checkout.dir}\${project.name}" CheckExternals="false" UseLocalRevision="false" />  
   5.     </modificationset>  
   6.     <schedule Interval="300">  
   7.       <maven2 Goal="-e clean site install" MvnHome="D:\OpenSource\maven-2.0.4" PomFile="${checkout.dir}/${project.name}/pom.xml" ShowProgress="false" />  
   8.     </schedule>  
   9.     <bootstrappers>  
  10.       <svnbootstrapper LocalWorkingCopy="${checkout.dir}\${project.name}" />  
  11.     </bootstrappers>  
  12.     <listeners>  
  13.       <currentbuildstatuslistener File="${logs.dir}\${project.name}\status.txt" />  
  14.     </listeners>  
  15.     <log>  
  16.       <merge Dir="${logs.dir}\${project.name}" />  
  17.       <merge Dir="${checkout.dir}\${project.name}\target" Pattern="*.xml" />  
  18.     </log>  
  19.     <publishers>  
  20.       <onsuccess>  
  21.         <artifactspublisher Dest="${artifact.dir}\${project.name}" File="${checkout.dir}\${project.name}\target\${project.name}-1.0-SNAPSHOT.war" />  
  22.       </onsuccess>  
  23.       <artifactspublisher File="${checkout.dir}\${project.name}\target\${project.name}-1.0-SNAPSHOT.war" Dest="artifacts/${project.name}" />  
  24.       <artifactspublisher Dir="${checkout.dir}\${project.name}\target\site" Dest="artifacts/${project.name}" />  
  25.     </publishers>  
  26.     <property name="checkout.dir" value="${basedir}\checkout" />  
  27.     <property name="logs.dir" value="${basedir}\logs" />  
  28.     <property name="artifact.dir" value="${basedir}\artifacts" />  
  29.   </project>  
  30.   <project requiremodification="false" forceonly="false" name="AntBasedCI">  
  31.     <modificationset QuietPeriod="30">  
  32.       <svn LocalWorkingCopy="${checkout.dir}\${project.name}" CheckExternals="false" UseLocalRevision="false" />  
  33.     </modificationset>  
  34.     <schedule Interval="300">  
  35.       <ant AntHome="D:\OpenSource\apache-ant-1.7.1" BuildFile="${checkout.dir}\${project.name}\build.xml" Target="all" />  
  36.     </schedule>  
  37.     <bootstrappers>  
  38.       <svnbootstrapper LocalWorkingCopy="${checkout.dir}\${project.name}" />  
  39.     </bootstrappers>  
  40.     <listeners>  
  41.       <currentbuildstatuslistener File="${logs.dir}\${project.name}\status.txt" />  
  42.     </listeners>  
  43.     <log>  
  44.       <merge Dir="${logs.dir}\${project.name}" />  
  45.       <merge Dir="${checkout.dir}\${project.name}\target" Pattern="*.xml" />  
  46.     </log>  
  47.     <publishers>  
  48.       <onsuccess>  
  49.         <artifactspublisher Dest="${artifact.dir}\${project.name}" File="${checkout.dir}\${project.name}\target\${project.name}.jar" />  
  50.       </onsuccess>  
  51.       <artifactspublisher Dest="artifacts/${project.name}" File="${checkout.dir}\${project.name}\target\${project.name}.jar" />  
  52.       <artifactspublisher Dir="${checkout.dir}\${project.name}\target" Dest="artifacts/${project.name}" />  
  53.     </publishers>  
  54.   </project>  
  55.   <dashboard />  
  56.   <property name="basedir" value="E:\CI\ccworkspace" />  
  57.   <property name="checkout.dir" value="${basedir}\checkout" />  
  58.   <property name="logs.dir" value="${basedir}\logs" />  
  59.   <property name="artifact.dir" value="${basedir}\artifacts" />  
  60. </cruisecontrol></strong></strong></strong>  

<cruisecontrol>
   <project requiremodification="false" forceonly="false" name="MavenBasedCI">
    <modificationset QuietPeriod="30">
      <svn LocalWorkingCopy="${checkout.dir}\${project.name}" CheckExternals="false" UseLocalRevision="false" />
    </modificationset>
    <schedule Interval="300">
      <maven2 Goal="-e clean site install" MvnHome="D:\OpenSource\maven-2.0.4" PomFile="${checkout.dir}/${project.name}/pom.xml" ShowProgress="false" />
    </schedule>
    <bootstrappers>
      <svnbootstrapper LocalWorkingCopy="${checkout.dir}\${project.name}" />
    </bootstrappers>
    <listeners>
      <currentbuildstatuslistener File="${logs.dir}\${project.name}\status.txt" />
    </listeners>
    <log>
      <merge Dir="${logs.dir}\${project.name}" />
      <merge Dir="${checkout.dir}\${project.name}\target" Pattern="*.xml" />
    </log>
    <publishers>
      <onsuccess>
        <artifactspublisher Dest="${artifact.dir}\${project.name}" File="${checkout.dir}\${project.name}\target\${project.name}-1.0-SNAPSHOT.war" />
      </onsuccess>
      <artifactspublisher File="${checkout.dir}\${project.name}\target\${project.name}-1.0-SNAPSHOT.war" Dest="artifacts/${project.name}" />
      <artifactspublisher Dir="${checkout.dir}\${project.name}\target\site" Dest="artifacts/${project.name}" />
    </publishers>
    <property name="checkout.dir" value="${basedir}\checkout" />
    <property name="logs.dir" value="${basedir}\logs" />
    <property name="artifact.dir" value="${basedir}\artifacts" />
  </project>
  <project requiremodification="false" forceonly="false" name="AntBasedCI">
    <modificationset QuietPeriod="30">
      <svn LocalWorkingCopy="${checkout.dir}\${project.name}" CheckExternals="false" UseLocalRevision="false" />
    </modificationset>
    <schedule Interval="300">
      <ant AntHome="D:\OpenSource\apache-ant-1.7.1" BuildFile="${checkout.dir}\${project.name}\build.xml" Target="all" />
    </schedule>
    <bootstrappers>
      <svnbootstrapper LocalWorkingCopy="${checkout.dir}\${project.name}" />
    </bootstrappers>
    <listeners>
      <currentbuildstatuslistener File="${logs.dir}\${project.name}\status.txt" />
    </listeners>
    <log>
      <merge Dir="${logs.dir}\${project.name}" />
      <merge Dir="${checkout.dir}\${project.name}\target" Pattern="*.xml" />
    </log>
    <publishers>
      <onsuccess>
        <artifactspublisher Dest="${artifact.dir}\${project.name}" File="${checkout.dir}\${project.name}\target\${project.name}.jar" />
      </onsuccess>
      <artifactspublisher Dest="artifacts/${project.name}" File="${checkout.dir}\${project.name}\target\${project.name}.jar" />
      <artifactspublisher Dir="${checkout.dir}\${project.name}\target" Dest="artifacts/${project.name}" />
    </publishers>
  </project>
  <dashboard />
  <property name="basedir" value="E:\CI\ccworkspace" />
  <property name="checkout.dir" value="${basedir}\checkout" />
  <property name="logs.dir" value="${basedir}\logs" />
  <property name="artifact.dir" value="${basedir}\artifacts" />
</cruisecontrol>

         上面的配置是通过CC-Config图形配置自动生成的,包含我们的两个工程。

         Ant配置build.xml
Xml代码

   1. <strong><strong><strong><?xml version="1.0" encoding="UTF-8"?>  
   2. <project name="AntBasedCI" default="all">  
   3.   
   4.     <property name="default.target.dir" value="target" />  
   5.     <property name="classes.dir" value="${default.target.dir}/classes" />  
   6.     <property name="test.classes.dir" value="${default.target.dir}/test-classes" />  
   7.     <property name="test.report.dir" value="${default.target.dir}/test-reports" />  
   8.     <property name="lib.dir" value="${basedir}/lib" />  
   9.     <property name="javadoc.dir" value="${default.target.dir}/apidocs" />  
  10.   
  11.     <property name="source.dir" value="src" />  
  12.     <property name="test.source.dir" value="test" />  
  13.   
  14.     <property name="test.pattern" value="**/**Test.java" />  
  15.   
  16.     <!-- Coverage reports are deposited into these directories -->  
  17.     <property name="cobertura.dir" value="${default.target.dir}/cobertura"/>  
  18.     <!-- Instrumented classes are deposited into this directory -->  
  19.     <property name="instrumented.dir" value="instrumented" />  
  20.       
  21.     <path id="cobertura.classpath">  
  22.         <fileset dir="${lib.dir}">  
  23.             <include name="*.jar" />  
  24.         </fileset>  
  25.     </path>  
  26.       
  27.     <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>  
  28.       
  29.     <target name="clean">  
  30.         <delete dir="${classes.dir}"/>  
  31.         <delete dir="${test.classes.dir}"/>  
  32.         <delete dir="${default.target.dir}"/>  
  33.     </target>  
  34.       
  35.     <target name="init" depends="clean">  
  36.         <mkdir dir="${classes.dir}" />  
  37.         <mkdir dir="${test.classes.dir}" />  
  38.         <mkdir dir="${javadoc.dir}" />  
  39.         <mkdir dir="${default.target.dir}"/>  
  40.         <mkdir dir="${instrumented.dir}"/>          
  41.         <path id="build.classpath">  
  42.             <fileset dir="${lib.dir}">  
  43.                 <include name="**/*.jar" />  
  44.             </fileset>  
  45.             <fileset dir="${default.target.dir}">  
  46.                 <include name="**/*.jar" />  
  47.             </fileset>  
  48.         </path>  
  49.     </target>  
  50.       
  51.     <target name="compile-source" depends="init" description="compiles all .java files in source directory ">  
  52.         <javac destdir="${classes.dir}" srcdir="${source.dir}" classpathref="build.classpath" />  
  53.     </target>  
  54.       
  55.     <target name="instrument" depends="compile-source">  
  56.         <delete file="cobertura.ser"/>  
  57.         <delete dir="${instrumented.dir}" />  
  58.           
  59.         <!--Instrument the application classes, writing the instrumented classes into ${build.instrumented.dir}.-->  
  60.         <cobertura-instrument todir="${instrumented.dir}">  
  61.             <ignore regex="org.apache.log4j.*" />  
  62.             <fileset dir="${classes.dir}">  
  63.                 <!-- Instrument all the application classes, but don't instrument the test classes.-->  
  64.                 <include name="**/*.class" />  
  65.                 <exclude name="**/*Test.class" />  
  66.             </fileset>  
  67.         </cobertura-instrument>  
  68.     </target>  
  69.           
  70.     <target name="jar" depends="instrument">  
  71.         <jar jarfile="${default.target.dir}/${ant.project.name}.jar" basedir="${classes.dir}" />  
  72.     </target>  
  73.       
  74.     <target name="compile-tests" depends="jar" description="compiles all .java files in test directory ">  
  75.         <javac destdir="${test.classes.dir}" srcdir="${test.source.dir}" classpathref="build.classpath" />  
  76.     </target>  
  77.   
  78.     <target name="javadoc" depends="init">  
  79.         <javadoc author="true" charset="gbk" classpathref="build.classpath"   
  80.             destdir="${javadoc.dir}" version="true" use="true" sourcepath="${source.dir}"></javadoc>  
  81.     </target>  
  82.       
  83.     <target name="test" depends="compile-tests" description="runs JUnit tests">  
  84.         <mkdir dir="${test.report.dir}" />  
  85.         <junit dir="${basedir}" printSummary="on" fork="true" haltonfailure="true">  
  86.             <sysproperty key="basedir" value="${basedir}" />  
  87.             <formatter type="xml" />  
  88.             <classpath>  
  89.                 <path refid="build.classpath" />  
  90.                 <pathelement path="${test.classes.dir}" />  
  91.                 <pathelement path="${classes.dir}" />  
  92.             </classpath>  
  93.             <batchtest todir="${test.report.dir}">  
  94.                 <fileset dir="${test.source.dir}">  
  95.                     <include name="${test.pattern}" />  
  96.                 </fileset>  
  97.             </batchtest>  
  98.         </junit>  
  99.     </target>  
 100.               
 101.     <target name="coverage-check">  
 102.         <cobertura-check branchrate="40" totallinerate="100" />  
 103.     </target>  
 104.   
 105.     <target name="coverage-report">  
 106.         <cobertura-report srcdir="${source.dir}" destdir="${cobertura.dir}" format="html" />  
 107.     </target>  
 108.       
 109.     <target name="alternate-coverage-report">  
 110.         <!--  
 111.                 Generate a series of HTML files containing the coverage  
 112.                 data in a user-readable form using nested source filesets.  
 113.             -->  
 114.         <cobertura-report destdir="${cobertura.dir}">  
 115.             <fileset dir="${source.dir}">  
 116.                 <include name="**/*.java"/>  
 117.             </fileset>  
 118.         </cobertura-report>  
 119.     </target>  
 120.               
 121.     <target name="coverage" depends="jar,instrument,test,coverage-report,alternate-coverage-report"/>   
 122.       
 123.     <target name="pmd" depends="test">  
 124.         <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="build.classpath"/>  
 125.         <pmd>  
 126.             <ruleset>rulesets/basic.xml</ruleset>  
 127.             <ruleset>rulesets/braces.xml</ruleset>  
 128.             <ruleset>rulesets/javabeans.xml</ruleset>  
 129.             <ruleset>rulesets/unusedcode.xml</ruleset>  
 130.             <ruleset>rulesets/strings.xml</ruleset>  
 131.             <ruleset>rulesets/design.xml</ruleset>  
 132.             <ruleset>rulesets/coupling.xml</ruleset>  
 133.             <ruleset>rulesets/codesize.xml</ruleset>  
 134.             <ruleset>rulesets/imports.xml</ruleset>  
 135.             <ruleset>rulesets/naming.xml</ruleset>  
 136.             <formatter type="xml" toFile="${default.target.dir}/pmd_report.xml" />  
 137.             <fileset dir="${source.dir}">  
 138.                 <include name="**/*.java" />  
 139.             </fileset>  
 140.         </pmd>  
 141.     </target>  
 142.       
 143.     <target name="findbugs" depends="jar">  
 144.         <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"  
 145.         classpathref="build.classpath" />  
 146.         <findbugs classpathref="build.classpath" pluginlist="${lib.dir}/coreplugin-1.0.jar"  
 147.         output="xml" outputFile="${default.target.dir}/findbugs.xml">  
 148.             <sourcePath path="${source.dir}" />  
 149.             <class location="${default.target.dir}/${ant.project.name}.jar" />  
 150.         </findbugs>  
 151.     </target>  
 152.   
 153.     <target name="all" depends="coverage,pmd,findbugs,javadoc" />  
 154.       
 155. </project>  
 156. </strong></strong></strong>  

<?xml version="1.0" encoding="UTF-8"?>
<project name="AntBasedCI" default="all">

	<property name="default.target.dir" value="target" />
	<property name="classes.dir" value="${default.target.dir}/classes" />
	<property name="test.classes.dir" value="${default.target.dir}/test-classes" />
	<property name="test.report.dir" value="${default.target.dir}/test-reports" />
	<property name="lib.dir" value="${basedir}/lib" />
	<property name="javadoc.dir" value="${default.target.dir}/apidocs" />

	<property name="source.dir" value="src" />
	<property name="test.source.dir" value="test" />

	<property name="test.pattern" value="**/**Test.java" />

	<!-- Coverage reports are deposited into these directories -->
	<property name="cobertura.dir" value="${default.target.dir}/cobertura"/>
	<!-- Instrumented classes are deposited into this directory -->
	<property name="instrumented.dir" value="instrumented" />
	
	<path id="cobertura.classpath">
		<fileset dir="${lib.dir}">
			<include name="*.jar" />
		</fileset>
	</path>
	
	<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
	
	<target name="clean">
		<delete dir="${classes.dir}"/>
		<delete dir="${test.classes.dir}"/>
		<delete dir="${default.target.dir}"/>
	</target>
	
	<target name="init" depends="clean">
		<mkdir dir="${classes.dir}" />
		<mkdir dir="${test.classes.dir}" />
		<mkdir dir="${javadoc.dir}" />
		<mkdir dir="${default.target.dir}"/>
		<mkdir dir="${instrumented.dir}"/>		
		<path id="build.classpath">
			<fileset dir="${lib.dir}">
				<include name="**/*.jar" />
			</fileset>
			<fileset dir="${default.target.dir}">
				<include name="**/*.jar" />
			</fileset>
		</path>
	</target>
	
	<target name="compile-source" depends="init" description="compiles all .java files in source directory ">
		<javac destdir="${classes.dir}" srcdir="${source.dir}" classpathref="build.classpath" />
	</target>
	
	<target name="instrument" depends="compile-source">
		<delete file="cobertura.ser"/>
		<delete dir="${instrumented.dir}" />
		
		<!--Instrument the application classes, writing the instrumented classes into ${build.instrumented.dir}.-->
		<cobertura-instrument todir="${instrumented.dir}">
			<ignore regex="org.apache.log4j.*" />
			<fileset dir="${classes.dir}">
				<!-- Instrument all the application classes, but don't instrument the test classes.-->
				<include name="**/*.class" />
				<exclude name="**/*Test.class" />
			</fileset>
		</cobertura-instrument>
	</target>
		
	<target name="jar" depends="instrument">
		<jar jarfile="${default.target.dir}/${ant.project.name}.jar" basedir="${classes.dir}" />
	</target>
	
	<target name="compile-tests" depends="jar" description="compiles all .java files in test directory ">
		<javac destdir="${test.classes.dir}" srcdir="${test.source.dir}" classpathref="build.classpath" />
	</target>

	<target name="javadoc" depends="init">
		<javadoc author="true" charset="gbk" classpathref="build.classpath" 
			destdir="${javadoc.dir}" version="true" use="true" sourcepath="${source.dir}"></javadoc>
	</target>
	
	<target name="test" depends="compile-tests" description="runs JUnit tests">
		<mkdir dir="${test.report.dir}" />
		<junit dir="${basedir}" printSummary="on" fork="true" haltonfailure="true">
			<sysproperty key="basedir" value="${basedir}" />
			<formatter type="xml" />
			<classpath>
				<path refid="build.classpath" />
				<pathelement path="${test.classes.dir}" />
				<pathelement path="${classes.dir}" />
			</classpath>
			<batchtest todir="${test.report.dir}">
				<fileset dir="${test.source.dir}">
					<include name="${test.pattern}" />
				</fileset>
			</batchtest>
		</junit>
	</target>
			
	<target name="coverage-check">
		<cobertura-check branchrate="40" totallinerate="100" />
	</target>

	<target name="coverage-report">
		<cobertura-report srcdir="${source.dir}" destdir="${cobertura.dir}" format="html" />
	</target>
	
	<target name="alternate-coverage-report">
		<!--
                Generate a series of HTML files containing the coverage
                data in a user-readable form using nested source filesets.
            -->
		<cobertura-report destdir="${cobertura.dir}">
			<fileset dir="${source.dir}">
				<include name="**/*.java"/>
			</fileset>
		</cobertura-report>
	</target>
			
	<target name="coverage" depends="jar,instrument,test,coverage-report,alternate-coverage-report"/>	
	
	<target name="pmd" depends="test">
		<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="build.classpath"/>
		<pmd>
			<ruleset>rulesets/basic.xml</ruleset>
			<ruleset>rulesets/braces.xml</ruleset>
			<ruleset>rulesets/javabeans.xml</ruleset>
			<ruleset>rulesets/unusedcode.xml</ruleset>
			<ruleset>rulesets/strings.xml</ruleset>
			<ruleset>rulesets/design.xml</ruleset>
			<ruleset>rulesets/coupling.xml</ruleset>
			<ruleset>rulesets/codesize.xml</ruleset>
			<ruleset>rulesets/imports.xml</ruleset>
			<ruleset>rulesets/naming.xml</ruleset>
			<formatter type="xml" toFile="${default.target.dir}/pmd_report.xml" />
			<fileset dir="${source.dir}">
				<include name="**/*.java" />
			</fileset>
		</pmd>
	</target>
	
	<target name="findbugs" depends="jar">
		<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
	    classpathref="build.classpath" />
		<findbugs classpathref="build.classpath" pluginlist="${lib.dir}/coreplugin-1.0.jar"
	    output="xml" outputFile="${default.target.dir}/findbugs.xml">
			<sourcePath path="${source.dir}" />
			<class location="${default.target.dir}/${ant.project.name}.jar" />
		</findbugs>
	</target>

	<target name="all" depends="coverage,pmd,findbugs,javadoc" />
	
</project>

         从上面的配置我们看到这个构建包括:编译、测试、测试覆盖率统计、代码检查、BUG查找、生成Javadoc和打包。

          Maven的配置pom.xml
Xml代码

   1. <strong><strong><strong><?xml version="1.0" encoding="GBK"?>  
   2. <project xmlns="http://maven.apache.org/POM/4.0.0"  
   3.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
   4.     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">  
   5.     <modelVersion>4.0.0</modelVersion>  
   6.     <groupId>com.samueli.webapp</groupId>  
   7.     <artifactId>MavenBasedCI</artifactId>  
   8.     <packaging>war</packaging>  
   9.     <version>1.0-SNAPSHOT</version>  
  10.     <name>MavenBasedCI</name>  
  11.     <description>持续集成测试项目</description>  
  12.     <url>http://www.samueli.com</url>  
  13.     <licenses>  
  14.         <license>  
  15.             <name>Fake License</name>  
  16.             <url>http://127.0.0.1:8080/dc-license.txt</url>  
  17.             <distribution>repo</distribution>  
  18.         </license>  
  19.     </licenses>  
  20.     <!-- 问题管理 -->  
  21.     <issueManagement>  
  22.         <system>jira</system>  
  23.         <url>http://169.254.11.166:8088/secure/Dashboard.jspa</url>  
  24.     </issueManagement>  
  25.     <!-- 源代码管理 -->  
  26.     <scm>  
  27.         <connection>scm:svn://127.0.0.1/repos/MavenBasedCI</connection>  
  28.         <developerConnection>  
  29.             scm:svn://127.0.0.1/repos/MavenBasedCI  
  30.         </developerConnection>  
  31.         <tag>head</tag>  
  32.         <url>svn://127.0.0.1/repos/MavenBasedCI</url>  
  33.     </scm>  
  34.   
  35.     <!-- 开发人员以及角色定义 -->  
  36.     <developers>  
  37.         <developer>  
  38.             <name>aaa</name>  
  39.             <id>aaa</id>  
  40.             <email>aaa@samueli.com</email>  
  41.             <organization>samueli</organization>  
  42.             <roles>  
  43.                 <role>PM</role>  
  44.             </roles>  
  45.         </developer>  
  46.         <developer>  
  47.             <name>bbb</name>  
  48.             <id>bbb</id>  
  49.             <email>bbb@samueli.com</email>  
  50.             <organization>samueli</organization>  
  51.             <roles>  
  52.                 <role>设计人员</role>  
  53.                 <role>开发人员</role>  
  54.             </roles>  
  55.         </developer>  
  56.     </developers>  
  57.   
  58.     <!-- 依赖定义 -->  
  59.     <dependencies>  
  60.         <dependency>  
  61.             <groupId>junit</groupId>  
  62.             <artifactId>junit</artifactId>  
  63.             <version>3.8.1</version>  
  64.             <scope>test</scope>  
  65.         </dependency>  
  66.         <dependency>  
  67.             <groupId>commons-lang</groupId>  
  68.             <artifactId>commons-lang</artifactId>  
  69.             <version>2.3</version>  
  70.         </dependency>  
  71.     </dependencies>  
  72.   
  73.     <!--依赖版本管理-->  
  74.     <dependencyManagement />  
  75.     <organization>  
  76.         <name>XXX有限责任公司</name>  
  77.         <url>http://www.samueli.com</url>  
  78.     </organization>  
  79.   
  80.     <!--项目模块管理-->  
  81.     <modules />  
  82.   
  83.     <build>  
  84.         <plugins>  
  85.             <plugin>  
  86.                 <artifactId>maven-site-plugin</artifactId>  
  87.                 <configuration>  
  88.                     <locales>zh_CN</locales>  
  89.                     <outputEncoding>GBK</outputEncoding>  
  90.                 </configuration>  
  91.             </plugin>  
  92.             <plugin>  
  93.                 <artifactId>maven-compiler-plugin</artifactId>  
  94.                 <configuration>  
  95.                     <source>1.5</source>  
  96.                     <target>1.5</target>  
  97.                     <encoding>GBK</encoding>  
  98.                 </configuration>  
  99.             </plugin>  
 100.             <plugin>  
 101.                 <artifactId>maven-checkstyle-plugin</artifactId>  
 102.                 <configuration>  
 103.                     <outputEncoding>GBK</outputEncoding>  
 104.                 </configuration>  
 105.             </plugin>  
 106.             <plugin>  
 107.                 <groupId>org.apache.maven.plugins</groupId>  
 108.                 <artifactId>maven-pmd-plugin</artifactId>  
 109.                 <executions>  
 110.                     <execution>  
 111.                         <goals>  
 112.                             <goal>check</goal>  
 113.                         </goals>  
 114.                     </execution>  
 115.                 </executions>  
 116.                 <configuration>  
 117.                     <linkXref>true</linkXref>  
 118.                     <sourceEncoding>GBK</sourceEncoding>  
 119.                 </configuration>  
 120.             </plugin>  
 121.             <plugin>  
 122.                 <groupId>org.codehaus.mojo</groupId>  
 123.                 <artifactId>cobertura-maven-plugin</artifactId>  
 124.                 <version>2.0</version>  
 125.                 <configuration>  
 126.                     <instrumentation>  
 127.                         <excludes>  
 128.                             <exclude>  
 129.                                 com/samueli/MavenBasedCI/util/*.class  
 130.                             </exclude>  
 131.                         </excludes>  
 132.                     </instrumentation>  
 133.                     <check>  
 134.                         <haltOnFailure>true</haltOnFailure>  
 135.                         <totalLineRate>40</totalLineRate>  
 136.                         <totalBranchRate>100</totalBranchRate>  
 137.                     </check>  
 138.                     <outputEncoding>GBK</outputEncoding>  
 139.                 </configuration>  
 140.                 <executions>  
 141.                     <execution>  
 142.                         <id>clean</id>  
 143.                         <goals>  
 144.                             <goal>clean</goal>  
 145.                         </goals>  
 146.                     </execution>  
 147.                     <execution>  
 148.                         <id>check</id>  
 149.                         <goals>  
 150.                             <goal>check</goal>  
 151.                         </goals>  
 152.                     </execution>  
 153.                 </executions>  
 154.             </plugin>  
 155.         </plugins>  
 156.         <extensions>  
 157.             <extension>  
 158.                 <groupId>org.apache.maven.wagon</groupId>  
 159.                 <artifactId>wagon-ftp</artifactId>  
 160.                 <version>1.0-alpha-6</version>  
 161.             </extension>  
 162.         </extensions>  
 163.     </build>  
 164.   
 165.     <distributionManagement>  
 166.         <repository>  
 167.             <id>ftp-repository</id>  
 168.             <url>ftp://192.168.3.241</url>  
 169.         </repository>  
 170.         <site>  
 171.             <id>lmss.site</id>  
 172.             <name>MavenBasedCI</name>  
 173.             <url>file:///Y:\</url>  
 174.         </site>  
 175.     </distributionManagement>  
 176.   
 177.     <!--各种报告-->  
 178.     <reporting>  
 179.         <plugins>  
 180.             <plugin>  
 181.                 <artifactId>maven-site-plugin</artifactId>  
 182.                 <configuration>  
 183.                     <locales>zh_CN</locales>  
 184.                     <outputEncoding>GBK</outputEncoding>  
 185.                 </configuration>  
 186.             </plugin>  
 187.             <plugin>  
 188.                 <artifactId>maven-surefire-report-plugin</artifactId>  
 189.                 <configuration>  
 190.                     <showSuccess>false</showSuccess>  
 191.                     <outputEncoding>GBK</outputEncoding>  
 192.                 </configuration>  
 193.             </plugin>  
 194.             <plugin>  
 195.                 <groupId>org.apache.maven.plugins</groupId>  
 196.                 <artifactId>maven-jxr-plugin</artifactId>  
 197.                 <configuration>  
 198.                     <outputEncoding>GBK</outputEncoding>  
 199.                     <inputEncoding>GBK</inputEncoding>  
 200.                 </configuration>  
 201.             </plugin>  
 202.             <plugin>  
 203.                 <groupId>org.apache.maven.plugins</groupId>  
 204.                 <artifactId>maven-javadoc-plugin</artifactId>  
 205.                 <configuration>  
 206.                     <aggregate>true</aggregate>  
 207.                     <charset>UTF16</charset>  
 208.                 </configuration>  
 209.             </plugin>  
 210.             <plugin>  
 211.                 <groupId>org.apache.maven.plugins</groupId>  
 212.                 <artifactId>maven-pmd-plugin</artifactId>  
 213.                 <configuration>  
 214.                     <rulesets>  
 215.                         <ruleset>/rulesets/basic.xml</ruleset>  
 216.                         <ruleset>/rulesets/imports.xml</ruleset>  
 217.                         <ruleset>/rulesets/unusedcode.xml</ruleset>  
 218.                         <ruleset>/rulesets/finalizers.xml</ruleset>  
 219.                     </rulesets>  
 220.                     <outputEncoding>GBK</outputEncoding>  
 221.                     <linkXref>true</linkXref>  
 222.                     <excludes>  
 223.                         <exclude>  
 224.                             com/samueli/MavenBasedCI/util/*.java  
 225.                         </exclude>  
 226.                     </excludes>  
 227.                 </configuration>  
 228.             </plugin>  
 229.             <plugin>  
 230.                 <groupId>org.apache.maven.plugins</groupId>  
 231.                 <artifactId>maven-checkstyle-plugin</artifactId>  
 232.                 <configuration>  
 233.                     <configLocation>lmss_checks.xml</configLocation>  
 234.                     <outputEncoding>GBK</outputEncoding>  
 235.                 </configuration>  
 236.             </plugin>  
 237.             <plugin>  
 238.                 <groupId>org.codehaus.mojo</groupId>  
 239.                 <artifactId>taglist-maven-plugin</artifactId>  
 240.                 <configuration>  
 241.                     <tags>  
 242.                         <tag>TODO</tag>  
 243.                         <tag>@todo</tag>  
 244.                         <tag>FIXME</tag>  
 245.                         <tag>XXX</tag>  
 246.                     </tags>  
 247.                     <outputEncoding>GBK</outputEncoding>  
 248.                 </configuration>  
 249.             </plugin>  
 250.             <plugin>  
 251.                 <groupId>org.codehaus.mojo</groupId>  
 252.                 <artifactId>cobertura-maven-plugin</artifactId>  
 253.                 <version>2.0</version>  
 254.                 <configuration>  
 255.                     <outputEncoding>GBK</outputEncoding>  
 256.                 </configuration>  
 257.             </plugin>  
 258. <!--         <plugin>-->  
 259. <!--             <groupId>org.codehaus.mojo</groupId>-->  
 260. <!--             <artifactId>changes-maven-plugin</artifactId>-->  
 261. <!--         </plugin>-->  
 262.             <plugin>  



http://www.iteye.com/topic/239628



 263.                 <groupId>org.codehaus.mojo</groupId>  
 264.                 <artifactId>changelog-maven-plugin</artifactId>  
 265.             </plugin>  
 266.             <plugin>  
 267.                 <groupId>org.codehaus.mojo</groupId>  
 268.                 <artifactId>findbugs-maven-plugin</artifactId>  
 269.                 <configuration>  
 270.                     <xmlOutput>true</xmlOutput>  
 271.                 </configuration>  
 272.             </plugin>  
 273.   
 274.         </plugins>  
 275.     </reporting>  
 276. </project></strong></strong></strong> 
分享到:
评论

相关推荐

    PHP持续集成实践

    【PHP持续集成实践】 PHP持续集成是软件开发过程中的一个重要环节,它强调在开发过程中频繁地集成代码,并通过自动化的方式进行编译、测试和质量检查,以尽早发现并修复问题,提升软件的质量和稳定性。本实践主要...

    去 Jenkins 的持续集成实践.pdf

    总的来说,“去Jenkins”的持续集成实践是一种寻求更高效、更契合自身工作流程的解决方案的尝试。这涉及到对代码版本控制、CI工具选择、具体任务执行和事件处理的深入理解和定制。每个团队都应该根据自身的实际情况...

    NC总账持续集成实践

    【持续集成实践】 持续集成是现代软件开发中的关键实践,旨在早期发现并修复错误,提高软件质量。在NC(可能是SAP NetWeaver或类似产品)总账的开发过程中,持续集成扮演着至关重要的角色。NC总账持续集成实践涉及...

    高效客户端持续集成实践之路

    【高效客户端持续集成实践之路】 在敏捷开发的背景下,为了应对快速迭代和高并发的开发需求,客户端持续集成成为了解决方案的关键。闲鱼作为一款高频应用,采用泳道任务模式进行迭代,每两周推出一个新版本。面对...

    持续集成实践.docx

    持续集成实践 持续集成(Continuous Integration,CI)是一种软件开发实践,它强调在软件开发过程中频繁地集成代码,尽量减少集成的工作量和风险。这种实践可以帮助软件开发团队快速适应新的需求变化,快速增加新的...

    持续集成实践(姜林斌)

    在使用Jenkins进行持续集成实践时,第一步是安装Jenkins。在CentOS系统下,需要先安装Java Development Kit(JDK),因为Jenkins是基于Java开发的。JDK的安装包括创建安装目录、解压安装包,并配置Java的环境变量。...

    持续集成实践之CruiseContorl

    ### 持续集成实践之CruiseControl #### 前言 持续集成(Continuous Integration,简称CI)是一种软件开发实践,旨在通过频繁地合并所有开发者的工作副本到一个共享的主分支,并通过自动化的构建(包括编译、发布、...

    百度Devops持续集成实践.pptx

    【百度DevOps持续集成实践】是百度在应对日益复杂和快速变化的移动互联网环境中,针对客户端研发流程进行的一系列技术创新和优化。这一实践主要聚焦于提高研发效率、保证产品质量以及提升用户体验,通过DevOps的理念...

    持续集成实践之CruiseControl

    **持续集成实践之CruiseControl** 在软件开发领域,持续集成(Continuous Integration,简称CI)是一种重要的实践,它强调开发者频繁地将代码更改合并到主分支,以尽早发现并解决问题。CruiseControl是一款开源的...

    持续集成实践成熟度模型

    持续集成从“配置管理”、“构建”、“测试”、“部署及发布”及“团队习惯”5个纬度考察其成熟度,每个维度都有5个级别,分别是“入门”、“新手”、“中等”、“进阶”和“疯狂”。目前在各个维度上,行业的平均...

    微服务架构下Java API文档的持续集成实践

    因此,实现API文档的持续集成变得尤为重要。本文将详细介绍如何在Java微服务中实现API文档的持续集成,以及如何与Vue.js前端进行集成。 通过实现API文档的持续集成,可以确保微服务架构中的API文档始终保持最新和...

    企业IT持续集成与持续交付实践.pdf

    企业IT持续集成与持续交付实践 持续集成(Continuous Integration,CI)和持续交付(Continuous Delivery,CD)是企业IT实践中两个非常重要的概念,它们之间紧密相连,都是为了提高软件开发、测试和部署的效率和...

    Jenkins & Docker 持续集成实践

    详细讲解Jenkins 结合Docker的 持续集成方案,包含大量的实践案例,适合项目发布人员和配管人员学习。

    持续集成实践和Maven核心介绍

    博文链接:https://juvenshun.iteye.com/blog/249189

    持续集成实践之持续交付的五个核心实践

    持续集成实践之持续交付的五个核心实践!持续交付是一种软件开发策略,用于优化软件交付流程,以尽快得到高质量、有价值的软件。这种方法让你能更快地验证业务想法,通过直接在用户那里进行试验,做到快速迭代。尽管...

    python接口测试-持续集成实践

    本实践主要关注的是使用Python语言进行接口测试,并结合持续集成(Continuous Integration, CI)来确保代码的质量和稳定性。Python因其简洁易读的语法和丰富的第三方库,成为自动化测试的热门选择。 接口测试主要...

Global site tag (gtag.js) - Google Analytics