odlparent/pom.xml: Parameter tasks is deprecated
[odlparent.git] / odlparent / pom.xml
index 0a8601aac2d7f9f68dd236205cbb62e78adf56d3..2222f84346fbc83e60e3e0d0ee5be0ccfd4b4ea7 100644 (file)
@@ -13,7 +13,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>1.7.0-SNAPSHOT</version>
+    <version>1.8.0-SNAPSHOT</version>
     <relativePath>../odlparent-lite</relativePath>
   </parent>
 
     <maven.compile.plugin.version>3.5.1</maven.compile.plugin.version>
     <!-- Used in mdsal, yangtools -->
     <maven.jar.version>3.0.0</maven.jar.version>
-    <!-- Used in controller, coretutorials, mdsal, snbi, tcpmd5, yangtools -->
+    <!-- Used in controller, coretutorials, mdsal, snbi, yangtools -->
     <maven.javadoc.version>2.10.3</maven.javadoc.version>
     <!-- Used in snmp -->
     <maven.plugin.version>3.4</maven.plugin.version>
-    <!-- Used in neutron, of-config, tcpmd5, tsdr, yangtools -->
+    <!-- Used in neutron, of-config, tsdr, yangtools -->
     <!-- Later versions break tests in downstream projects -->
     <maven.surefire.version>2.18.1</maven.surefire.version>
 
@@ -76,7 +76,7 @@
          toolkit -->
     <checkstyle.version>2.17</checkstyle.version>
     <!-- Used in controller, packetcable -->
-    <odl.checkstyle.version>0.2.0-SNAPSHOT</odl.checkstyle.version>
+    <odl.checkstyle.version>0.3.0-SNAPSHOT</odl.checkstyle.version>
     <!-- Used in snmp4sdn; see also toolkit -->
     <compiler.version>${maven.compile.plugin.version}</compiler.version>
     <!-- Used in controller, l2switch, netide, openflowjava, openflowplugin, snbi, tsdr, ttp; see also toolkit -->
     <jacoco.version>0.7.2.201409121644</jacoco.version>
     <!-- Used in aaa, controller, coretutorials, integration/distribution, l2switch, lacp, lispflowmapping, netide,
          nic, openflowplugin, ovsdb, persistence, sfc, snbi, snmp4sdn?, sxp, topoprocessing, unimgr, vtn -->
-    <karaf.version>3.0.6</karaf.version>
+    <karaf.version>3.0.8</karaf.version>
     <!-- Used in lispflowmapping, snmp4sdn, vtn -->
     <projectinfo>2.8.1</projectinfo>
     <!-- Used in of-config; see also snmp4sdn -->
     <sonar.jacoco.itReportPath>target/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>
+
+    <pmd.cpd.fail>false</pmd.cpd.fail>
   </properties>
 
   <dependencyManagement>
       <dependency>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-artifacts</artifactId>
-        <version>1.7.0-SNAPSHOT</version>
+        <version>1.8.0-SNAPSHOT</version>
         <scope>import</scope>
         <type>pom</type>
       </dependency>
       <dependency>
          <groupId>org.skyscreamer</groupId>
          <artifactId>jsonassert</artifactId>
-         <version>1.2.3</version>
+         <version>1.3.0</version>
          <scope>test</scope>
       </dependency>
       <dependency>
         <version>1.3</version>
         <scope>test</scope>
       </dependency>
+      <dependency>
+        <groupId>com.google.truth</groupId>
+        <artifactId>truth</artifactId>
+        <version>0.28</version>
+        <scope>test</scope>
+      </dependency>
       <dependency>
         <groupId>org.powermock</groupId>
         <artifactId>powermock-api-mockito</artifactId>
         <version>18.0</version>
         <scope>test</scope>
       </dependency>
+      <dependency>
+        <groupId>com.mycila.guice.extensions</groupId>
+        <!-- This transitively pulls com.google.inject:guice along -->
+        <artifactId>mycila-guice-jsr250</artifactId>
+        <version>4.0.rc1</version>
+        <scope>test</scope>
+      </dependency>
       <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-lang3</artifactId>
       <dependency>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-core</artifactId>
-        <version>1.2.5</version>
+        <version>1.3.1</version>
       </dependency>
       <dependency>
         <groupId>org.apache.shiro</groupId>
         <artifactId>shiro-web</artifactId>
-        <version>1.2.5</version>
+        <version>1.3.1</version>
       </dependency>
 
       <!-- Plugin integration -->
       <dependency>
         <groupId>com.google.code.gson</groupId>
         <artifactId>gson</artifactId>
-        <version>2.3.1</version>
+        <version>2.7</version>
       </dependency>
       <dependency>
         <groupId>commons-fileupload</groupId>
       <dependency>
         <groupId>com.webcohesion.enunciate</groupId>
         <artifactId>enunciate-core-annotations</artifactId>
-        <version>2.1.1</version>
+        <version>2.6.0</version>
       </dependency>
       <dependency>
         <groupId>org.codehaus.jettison</groupId>
       <dependency>
         <groupId>org.ops4j.pax.url</groupId>
         <artifactId>pax-url-aether</artifactId>
-        <version>1.5.0</version>
+        <version>2.4.7</version>
         <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>org.ops4j.pax.url</groupId>
         <artifactId>pax-url-wrap</artifactId>
-        <version>1.5.0</version>
+        <version>2.4.7</version>
       </dependency>
       <dependency>
         <groupId>org.springframework.osgi</groupId>
           <version>2.9.2</version>
       </dependency>
 
+      <!-- Annotations -->
+      <dependency>
+        <groupId>javax.inject</groupId>
+        <artifactId>javax.inject</artifactId>
+        <version>1</version>
+      </dependency>
+
+      <!-- Cassandra -->
+      <dependency>
+        <groupId>com.datastax.cassandra</groupId>
+        <artifactId>cassandra-driver-core</artifactId>
+        <version>2.1.9</version>
+      </dependency>
+
+      <!-- Metrics -->
+      <dependency>
+        <groupId>io.dropwizard.metrics</groupId>
+        <artifactId>metrics-core</artifactId>
+        <version>3.1.2</version>
+      </dependency>
+      <dependency>
+        <groupId>io.dropwizard.metrics</groupId>
+        <artifactId>metrics-graphite</artifactId>
+        <version>3.1.2</version>
+      </dependency>
+
+      <!-- Karaf console support -->
+      <dependency>
+        <groupId>org.apache.karaf.shell</groupId>
+        <artifactId>org.apache.karaf.shell.console</artifactId>
+        <version>${karaf.version}</version>
+      </dependency>
+
     </dependencies>
   </dependencyManagement>
 
       <artifactId>slf4j-api</artifactId>
       <scope>provided</scope>
     </dependency>
+
+    <!-- Enable JSR-305 annotations everywhere -->
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>jsr305</artifactId>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
 
   <build>
             <dependency>
               <groupId>org.opendaylight.odlparent</groupId>
               <artifactId>odl-license</artifactId>
-              <version>0.1.0-SNAPSHOT</version>
+              <version>0.2.0-SNAPSHOT</version>
+            </dependency>
+            <dependency>
+              <groupId>com.github.sevntu.checkstyle</groupId>
+              <artifactId>sevntu-checkstyle-maven-plugin</artifactId>
+              <version>1.21.0</version>
             </dependency>
           </dependencies>
           <configuration>
             <!-- <sourceDirectory> is needed so that checkstyle ignores the
                  generated sources directory -->
             <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+            <includeResources>true</includeResources>
+            <includeTestSourceDirectory>true</includeTestSourceDirectory>
+            <includeTestResources>true</includeTestResources>
             <excludes>
               org/opendaylight/yang/gen/**,
               **/protobuff/messages/**,
                 <configLocation>check-license.xml</configLocation>
                 <headerLocation>EPL-LICENSE.regexp.txt</headerLocation>
                 <includeResources>false</includeResources>
+                <includeTestSourceDirectory>true</includeTestSourceDirectory>
                 <includeTestResources>false</includeTestResources>
                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                 <excludes>
             </execution>
           </executions>
         </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-pmd-plugin</artifactId>
+          <version>3.6</version>
+          <executions>
+            <execution>
+              <id>cpd</id>
+              <phase>process-sources</phase>
+              <goals>
+                <goal>cpd-check</goal>
+              </goals>
+              <configuration>
+                <failOnViolation>${pmd.cpd.fail}</failOnViolation>
+                <!-- 100 "tokens" here correspond to approx. 5-10 lines of code -->
+                <minimumTokens>101</minimumTokens>
+                <printFailingErrors>true</printFailingErrors>
+                <excludeRoots>
+                  <!-- FIXME: this should be a wildcard, but PMD is brain-damaged and does
+                              not understand path prefixes nor wildcards. Details are available
+                              at http://stackoverflow.com/questions/15647771/pmd-exclude-not-working
+                              Hence people introducing new generated sources have to include
+                              PMD config too.
+                   -->
+                  <excludeRoot>${basedir}/target/generated-sources</excludeRoot>
+                </excludeRoots>
+                <linkXRef>false</linkXRef>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
         <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
           <version>${maven.compile.plugin.version}</version>
           <configuration>
             <source>1.8</source>
             <target>1.8</target>
+            <compilerArgs>
+              <arg>-parameters</arg>
+            </compilerArgs>
           </configuration>
         </plugin>
         <plugin>
                   <artifactItem>
                     <groupId>org.opendaylight.odlparent</groupId>
                     <artifactId>odl-license</artifactId>
-                    <version>0.1.0-SNAPSHOT</version>
+                    <version>0.2.0-SNAPSHOT</version>
                   </artifactItem>
                 </artifactItems>
                 <outputDirectory>${project.build.outputDirectory}</outputDirectory>
         </plugin>
 
         <!-- Third-party plugins, grouped by groupId, alpha-sorted by artifactId -->
+        <plugin>
+          <!-- Support Blueprint XML construction using annotations -->
+          <groupId>org.apache.aries.blueprint</groupId>
+          <artifactId>blueprint-maven-plugin</artifactId>
+          <version>1.4.0</version>
+          <configuration>
+            <scanPaths>
+              <scanPath>org.opendaylight</scanPath>
+            </scanPaths>
+          </configuration>
+          <dependencies>
+            <dependency>
+              <!-- See https://issues.apache.org/jira/browse/ARIES-1596 -->
+              <!-- This shouldn't be necessary with plugin version 1.5.0 -->
+              <groupId>org.apache.xbean</groupId>
+              <artifactId>xbean-finder-shaded</artifactId>
+              <version>4.5</version>
+            </dependency>
+          </dependencies>
+          <executions>
+            <execution>
+              <goals>
+                <goal>blueprint-generate</goal>
+              </goals>
+            </execution>
+          </executions>
+        </plugin>
+
         <plugin>
           <groupId>org.apache.felix</groupId>
           <artifactId>maven-bundle-plugin</artifactId>
                     <ignore/>
                   </action>
                 </pluginExecution>
+                <pluginExecution>
+                  <pluginExecutionFilter>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-pmd-plugin</artifactId>
+                    <versionRange>[3.6,)</versionRange>
+                    <goals>
+                      <goal>cpd-check</goal>
+                    </goals>
+                  </pluginExecutionFilter>
+                  <action>
+                    <ignore/>
+                  </action>
+                </pluginExecution>
                 <pluginExecution>
                   <pluginExecutionFilter>
                     <groupId>org.apache.servicemix.tooling</groupId>
                   <version>1.8.0</version>
                 </requireJavaVersion>
                 <requireMavenVersion>
-                  <version>3.1.1</version>
+                  <version>[3.3.9,)</version>
                 </requireMavenVersion>
               </rules>
             </configuration>
       <plugin>
         <artifactId>maven-checkstyle-plugin</artifactId>
       </plugin>
+      <plugin>
+          <artifactId>maven-pmd-plugin</artifactId>
+      </plugin>
       <plugin>
         <artifactId>maven-source-plugin</artifactId>
       </plugin>
           </execution>
         </executions>
       </plugin>
+
+      <plugin>
+        <groupId>com.alexecollins.maven.plugin</groupId>
+        <artifactId>script-maven-plugin</artifactId>
+        <version>1.0.0</version>
+        <executions>
+           <execution>
+             <phase>prepare-package</phase>
+             <goals>
+               <goal>execute</goal>
+             </goals>
+             <configuration>
+               <script>
+                 // BeanShell is 2005-ish and thus doesn't support generics, varargs, try-with-resources or lambdas, so:
+                 // (If we do this kind of inline code in pom.xml more often, we shold have a new simple module in
+                 //  odl-parent, which has *.java that we compile, and then just depend on it here and call one-line
+                 //  static class methods only - it will be MUCH easier to write!)
+                 void copy(File root, String glob, File target) {
+                     java.nio.file.DirectoryStream dirStream = java.nio.file.Files.newDirectoryStream(root.toPath(), glob);
+                     Iterator dirStreamIterator = dirStream.iterator();
+                     while (dirStreamIterator.hasNext()) {
+                         java.nio.file.Path path = dirStreamIterator.next();
+                         java.nio.file.Files.copy(path, new File(target, path.toFile().getName()).toPath(),
+                             new java.nio.file.CopyOption[] {
+                                 java.nio.file.StandardCopyOption.REPLACE_EXISTING,
+                                 java.nio.file.StandardCopyOption.COPY_ATTRIBUTES
+                             }
+                         );
+                     }
+                     dirStream.close();
+                 }
+
+                 File gitRepoRootDir = project.basedir;
+                 while (!new File(gitRepoRootDir, ".git").exists() &amp;&amp; gitRepoRootDir.getParentFile() != null) {
+                     gitRepoRootDir = gitRepoRootDir.getParentFile();
+                 }
+
+                 File target = new File(project.build.outputDirectory);
+                 target.mkdirs();
+                 copy(gitRepoRootDir, "README*", target);
+                 copy(gitRepoRootDir, "CONTRIBUTING*", target);
+                 copy(gitRepoRootDir, "PROJECT_INFO.yaml", target);
+               </script>
+             </configuration>
+           </execution>
+         </executions>
+         <dependencies>
+           <dependency>
+             <groupId>org.apache-extras.beanshell</groupId>
+             <artifactId>bsh</artifactId>
+             <version>2.0b6</version>
+           </dependency>
+         </dependencies>
+      </plugin>
+
+      <!-- Blueprint dependency injection -->
+      <!-- Remove when upgrading to plugin 1.5.0, and use
+           <configuration><generatedDir>org/opendaylight/blueprint/</...></...> -->
+      <!-- See https://issues.apache.org/jira/browse/ARIES-1597 -->
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <!-- This should only run once, in the process-classes phase; but we need it to run after
+               process-classes in child projects. Attaching to process-test-classes and prepare-package
+               ensures that the file will be moved whether tests are skipped or not. -->
+          <execution>
+            <id>move-autowire-test</id>
+            <phase>process-test-classes</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <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"
+                      failonerror="false" quiet="true" />
+              </target>
+            </configuration>
+          </execution>
+          <execution>
+            <id>move-autowire-package</id>
+            <phase>prepare-package</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <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"
+                      failonerror="false" quiet="true" />
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 
       <url>${nexus.site.url}/${project.artifactId}/</url>
     </site>
   </distributionManagement>
+
 </project>