Add configuration and execution to FindBugs plugin
[odlparent.git] / odlparent / pom.xml
index 0ff8d4c4eb2258d7f65e0e208ad60f3c31e0c946..6dd4d224f735d01f10ad6b39a078588759d7dfee 100644 (file)
     <!-- Used in controller, didm, l2switch, lacp, persistence; see also toolkit, tsdr, ttp -->
     <maven.compile.plugin.version>3.5.1</maven.compile.plugin.version>
     <!-- Used in mdsal, yangtools -->
-    <maven.jar.version>3.0.0</maven.jar.version>
+    <maven.jar.version>3.0.2</maven.jar.version>
     <!-- Used in controller, coretutorials, mdsal, snbi, yangtools -->
     <maven.javadoc.version>2.10.4</maven.javadoc.version>
     <!-- Used in snmp -->
-    <maven.plugin.version>3.4</maven.plugin.version>
+    <maven.plugin.version>3.5</maven.plugin.version>
     <!-- Used in neutron, of-config, tsdr, yangtools -->
     <!-- Later versions break tests in downstream projects -->
     <maven.surefire.version>2.18.1</maven.surefire.version>
 
     <!-- Supporting Libraries -->
     <!-- Used by controller -->
-    <bouncycastle.version>1.54</bouncycastle.version>
+    <bouncycastle.version>1.55</bouncycastle.version>
 
     <!-- Used by controller, snbi; see also centinel, dlux, toolkit -->
     <osgi.core.version>5.0.0</osgi.core.version>
     <!-- Default Sonar configuration -->
     <sonar-jacoco-listeners.version>2.4</sonar-jacoco-listeners.version>
     <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
-    <sonar.jacoco.reportPath>target/code-coverage/jacoco.exec</sonar.jacoco.reportPath>
-    <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
+    <sonar.jacoco.reportPath>${project.build.directory}/code-coverage/jacoco.exec</sonar.jacoco.reportPath>
+    <sonar.jacoco.itReportPath>${project.build.directory}/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
     <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
     <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
 
       <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-lang3</artifactId>
-        <version>3.4</version>
+        <version>3.5</version>
       </dependency>
       <dependency>
         <groupId>commons-lang</groupId>
       <dependency>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-core</artifactId>
-        <version>1.3.1</version>
+        <version>1.3.2</version>
       </dependency>
       <dependency>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-web</artifactId>
-        <version>1.3.1</version>
+        <version>1.3.2</version>
       </dependency>
 
       <!-- Plugin integration -->
         <artifactId>jsr305</artifactId>
         <version>3.0.0</version>
       </dependency>
+      <dependency>
+        <groupId>com.google.code.findbugs</groupId>
+        <artifactId>annotations</artifactId>
+        <version>3.0.0</version>
+        <exclusions>
+          <!-- We'd like (have) to eventually exclude :jsr305 here as well, because
+               the types of this artifact are already shaded inside the :annotations artifact.
+               This state is a temporary solution to allow all projects to gradually switch over
+               switch their <dependency><groupId>com.google.code.findbugs from
+               <artifactId>jsr305 to <artifactId>annotations in all pom.xml.
+               The target solution is https://git.opendaylight.org/gerrit/#/c/47337/
+            -->
+          <exclusion>
+            <groupId>net.jcip</groupId>
+            <!-- The types of this artifact are already shaded inside the :annotations artifact -->
+            <artifactId>jcip-annotations</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
       <dependency>
         <groupId>com.google.code.gson</groupId>
         <artifactId>gson</artifactId>
       <scope>provided</scope>
     </dependency>
 
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <scope>test</scope>
+    </dependency>
+
     <!-- Enable JSR-305 annotations everywhere -->
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>annotations</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <!-- See note above; having both :jsr305 and :annotations here is an intermediate step -->
     <dependency>
       <groupId>com.google.code.findbugs</groupId>
       <artifactId>jsr305</artifactId>
                               Hence people introducing new generated sources have to include
                               PMD config too.
                    -->
-                  <excludeRoot>${basedir}/target/generated-sources</excludeRoot>
+                  <excludeRoot>${project.build.directory}/generated-sources</excludeRoot>
                 </excludeRoots>
                 <linkXRef>false</linkXRef>
               </configuration>
         </plugin>
         <plugin>
           <artifactId>maven-source-plugin</artifactId>
-          <version>3.0.0</version>
+          <version>3.0.1</version>
           <executions>
             <execution>
               <id>attach-sources</id>
           <version>${maven.surefire.version}</version>
           <configuration>
             <redirectTestOutputToFile>true</redirectTestOutputToFile>
+            <trimStackTrace>false</trimStackTrace>
           </configuration>
         </plugin>
 
           <artifactId>maven-enunciate-plugin</artifactId>
           <version>${enunciate.version}</version>
         </plugin>
-        <plugin>
-          <groupId>com.webcohesion.enunciate</groupId>
-          <artifactId>enunciate-maven-plugin</artifactId>
-          <version>2.1.1</version>
-        </plugin>
         <plugin>
           <groupId>org.codehaus.groovy.maven</groupId>
           <artifactId>gmaven-plugin</artifactId>
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>build-helper-maven-plugin</artifactId>
-          <version>1.10</version>
+          <version>1.12</version>
         </plugin>
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>findbugs-maven-plugin</artifactId>
-          <version>3.0.3</version>
+          <version>3.0.4</version>
+          <dependencies>
+            <dependency>
+              <groupId>org.opendaylight.odlparent</groupId>
+              <artifactId>findbugs</artifactId>
+              <version>1.8.0-SNAPSHOT</version>
+            </dependency>
+          </dependencies>
+          <configuration>
+            <!--
+              Enables analysis which takes more memory but finds more bugs.
+              If you run out of memory, changes the value of the effort element
+              to 'Low'.
+            -->
+            <effort>Max</effort>
+            <!-- Reports all bugs (other values are medium and max) -->
+            <threshold>Low</threshold>
+            <!-- Build doesn't fail if problems are found -->
+            <failOnError>false</failOnError>
+            <!-- References the excluded rules -->
+            <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
+            <!-- Produces XML report -->
+            <xmlOutput>true</xmlOutput>
+            <!-- Configures the directory in which the XML report is created -->
+            <findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory>
+            </configuration>
+            <executions>
+              <!--
+                Ensures that FindBugs inspects source code when project is compiled.
+              -->
+              <execution>
+                <id>analyze-compile</id>
+                <phase>compile</phase>
+                <goals>
+                  <goal>check</goal>
+                </goals>
+              </execution>
+            </executions>
         </plugin>
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
             <configuration>
               <target>
                 <echo>Moving autowire.xml to org/opendaylight/blueprint</echo>
-                <move file="${basedir}/target/generated-resources/OSGI-INF/blueprint/autowire.xml"
-                      todir="${basedir}/target/generated-resources/org/opendaylight/blueprint"
+                <move file="${project.build.directory}/generated-resources/OSGI-INF/blueprint/autowire.xml"
+                      todir="${project.build.directory}/generated-resources/org/opendaylight/blueprint"
                       failonerror="false" quiet="true" />
               </target>
             </configuration>
             <configuration>
               <target>
                 <echo>Moving autowire.xml to org/opendaylight/blueprint</echo>
-                <move file="${basedir}/target/generated-resources/OSGI-INF/blueprint/autowire.xml"
-                      todir="${basedir}/target/generated-resources/org/opendaylight/blueprint"
+                <move file="${project.build.directory}/generated-resources/OSGI-INF/blueprint/autowire.xml"
+                      todir="${project.build.directory}/generated-resources/org/opendaylight/blueprint"
                       failonerror="false" quiet="true" />
               </target>
             </configuration>
         <artifactId>maven-project-info-reports-plugin</artifactId>
         <version>${projectinfo}</version>
       </plugin-->
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>findbugs-maven-plugin</artifactId>
-        <configuration>
-          <effort>Max</effort>
-          <threshold>Low</threshold>
-          <goal>site</goal>
-        </configuration>
-      </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>jdepend-maven-plugin</artifactId>