commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1652234 - in /commons/proper/commons-parent/trunk: pom.xml src/changes/changes.xml
Date Thu, 15 Jan 2015 19:12:10 GMT
Author: sebb
Date: Thu Jan 15 19:12:10 2015
New Revision: 1652234

URL: http://svn.apache.org/r1652234
Log:
Added Animal Sniffer profile (active by default)

Modified:
    commons/proper/commons-parent/trunk/pom.xml
    commons/proper/commons-parent/trunk/src/changes/changes.xml

Modified: commons/proper/commons-parent/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/commons-parent/trunk/pom.xml?rev=1652234&r1=1652233&r2=1652234&view=diff
==============================================================================
--- commons/proper/commons-parent/trunk/pom.xml (original)
+++ commons/proper/commons-parent/trunk/pom.xml Thu Jan 15 19:12:10 2015
@@ -750,6 +750,74 @@ Version 37:
 
   <profiles>
 
+      <!-- 
+           Runs the Animal Sniffer plugin to check that generated code does not included
references
+           to methods/classes etc that are not present in the standard Java runtime for the
defined target version.
+           To bypass the checks, define "animal.sniffer.skip" as true, or create the file
"src/site/resources/profile.noanimal" 
+      -->
+
+      <profile>
+        <id>animal-sniffer</id>
+        <activation>
+          <!--  active unless the file is found -->
+          <file>
+            <missing>src/site/resources/profile.noanimal</missing>
+          </file>
+        </activation>
+        
+        <build>
+          <plugins>
+            <!-- convert maven.compiler.target - e.g. 1.6 - to the sniffer signature -
e.g. java16 -->
+            <plugin>
+              <groupId>org.codehaus.mojo</groupId>
+              <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.9.1</version>
+              <executions>
+                <execution>
+                  <id>regex-property</id>
+                  <phase>validate</phase>
+                  <goals>
+                    <goal>regex-property</goal>
+                  </goals>
+                  <configuration>
+                    <!-- generate the default animal sniffer java signature name from
the java target version -->
+                    <name>animal-sniffer.signature</name>
+                    <value>${maven.compiler.target}</value>
+                    <regex>^(\d)\.(\d)$</regex>
+                    <replacement>java$1$2</replacement>
+                    <failIfNoMatch>true</failIfNoMatch> <!-- unexpected compiler
version (assuming n.m version format)-->
+                  </configuration>
+                </execution>
+              </executions>
+            </plugin>
+
+            <!-- Run the Animal Sniffer checks -->
+            <plugin>
+              <groupId>org.codehaus.mojo</groupId>
+              <artifactId>animal-sniffer-maven-plugin</artifactId>
+              <version>1.13</version>
+              <executions>
+                <execution>
+                  <id>checkAPIcompatibility</id>
+                  <phase>test</phase>
+                  <goals>
+                    <goal>check</goal>
+                  </goals>
+                </execution>
+              </executions>
+              <configuration>
+                <signature>
+                  <groupId>org.codehaus.mojo.signature</groupId>
+                  <artifactId>${animal-sniffer.signature}</artifactId>
+                  <version>1.0</version>
+                </signature>
+              </configuration>
+            </plugin>
+
+          </plugins>
+        </build>
+      </profile>
+
     <profile>
       <id>jacoco</id>
       <activation>

Modified: commons/proper/commons-parent/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/commons-parent/trunk/src/changes/changes.xml?rev=1652234&r1=1652233&r2=1652234&view=diff
==============================================================================
--- commons/proper/commons-parent/trunk/src/changes/changes.xml (original)
+++ commons/proper/commons-parent/trunk/src/changes/changes.xml Thu Jan 15 19:12:10 2015
@@ -66,6 +66,7 @@ The <action> type attribute can be add,u
             <action type="update">Update org.apache:apache 15 to 16 (nop for Commons:
maven-compiler-plugin already contained source/target)</action>
             <action type="update">Update Maven Project Info Reports Plugin : 2.7 =>
2.8</action>
             <action type="update">merged maven-3 profile into main body (Maven 2 is
no longer supported)</action>
+            <action type="update">Added Animal Sniffer profile (active by default)</action>
         </release>
 
 	<release version="36" date="2014-12-21" description="Update plugins, fix release-notes
profile.">



Mime
View raw message