maven3和maven2不兼容引发的一次血案


       由于项目组的规定,谁提的代码将hudson弄红,谁大家吃冰激凌,简称IceCream Rules。 所以大家在提代码的时候必须先在本地执行mvn clean install。今天发现一个问题,一位同事在本地执行maven clean install是好的,提交到hudson上变红,于是就触发了该法测。原因如下:
       本地同事使用的是maven3,ci的hudson是maven2,maven2和maven3在reporting这一块的配置是不一样的,特意将maven2和maven3的配置记录在此,以后项目升级maven版本的时候可能会用得到。maven2的配置如下:


<reporting>
		<plugins>
			<plugin>
				<artifactId>maven-pmd-plugin</artifactId>
				<configuration>
					<linkXref>true</linkXref>
					<sourceEncoding>UTF-8</sourceEncoding>
					<targetJdk>1.6</targetJdk>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-changes-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<configuration>
					<configLocation>config/turbine_checks.xml</configLocation>
				</configuration>
			</plugin>
			
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>findbugs-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
			</plugin>
			<plugin>
				<artifactId>maven-jxr-plugin</artifactId>
			</plugin>
			
		</plugins>
	</reporting>



       maven3的配置如下:


<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-site-plugin</artifactId>
  <version>3.0-beta-3</version>
  <configuration>
    <reportPlugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.4</version>
        <reports>
          <report>license</report>
          <report>mailing-list</report>
          <report>dependencies</report>
          <report>dependency-convergence</report>
          <report>plugin-management</report>
          <report>cim</report>
          <report>issue-tracking</report>
          <report>scm</report>
          <report>summary</report>
        </reports>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.6</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.7</version>
      </plugin>     
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.6</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jdepend-maven-plugin</artifactId>
        <version>2.0-beta-2</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.4</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>taglist-maven-plugin</artifactId>
        <version>2.4</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>2.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <linkXref>true</linkXref>
          <minimumTokens>100</minimumTokens>
          <minimumPriority>3</minimumPriority>                                
          <targetJdk>1.6</targetJdk>
        </configuration>
      </plugin>
    </reportPlugins>
  </configuration>
</plugin>

你可能感兴趣的:(maven3,maven2)