Factored checkstyle config into it's own mvn project 81/781/3
authorEd Warnicke <eaw@cisco.com>
Sat, 3 Aug 2013 00:04:14 +0000 (19:04 -0500)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 5 Aug 2013 15:13:30 +0000 (15:13 +0000)
This allows correct handling of multimodule checkstyle as
documented here:

http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html

This involved:
- Adding a commons/checkstyle module to hold the space_and_tabs_checks.xml
- Altering commons/opendaylight to use commons/checkstyle
- Altering commons/concepts to use commons/checkstyle
- Altering commons/integrationtest to use commons/checkstyle
- Altering opendaylight/distribution to make sure to build commons/opendaylight
    and commons/checkstyle
- Altering opendaylight/distribution to exclude commons/checkstyle from the
    distribution zip file.

Change-Id: I36c23fc92ab8ec711861c7e9251a63b1aa60fd40
Signed-off-by: Ed Warnicke <eaw@cisco.com>
opendaylight/commons/checkstyle/pom.xml [new file with mode: 0644]
opendaylight/commons/checkstyle/src/main/resources/controller/space_and_tabs_checks.xml [moved from opendaylight/commons/opendaylight/space_and_tabs_checks.xml with 100% similarity]
opendaylight/commons/concepts/pom.xml
opendaylight/commons/integrationtest/pom.xml
opendaylight/commons/opendaylight/pom.xml
opendaylight/distribution/opendaylight/pom.xml
opendaylight/distribution/opendaylight/src/assemble/bin.xml

diff --git a/opendaylight/commons/checkstyle/pom.xml b/opendaylight/commons/checkstyle/pom.xml
new file mode 100644 (file)
index 0000000..50ffb4c
--- /dev/null
@@ -0,0 +1,6 @@
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.opendaylight.controller</groupId>
+  <artifactId>checkstyle</artifactId>
+  <version>0.0.1</version>
+</project>
index 9f3107d1a8fb666102a069b1daf625484d7e3ec2..fb8d9c1e10854fc54148b5736d43642848780a81 100644 (file)
         <groupId>org.apache.maven.plugins</groupId>\r
         <artifactId>maven-checkstyle-plugin</artifactId>\r
         <version>${checkstyle.version}</version>\r
         <groupId>org.apache.maven.plugins</groupId>\r
         <artifactId>maven-checkstyle-plugin</artifactId>\r
         <version>${checkstyle.version}</version>\r
+        <dependencies>\r
+          <dependency>\r
+            <groupId>org.opendaylight.controller</groupId>\r
+            <artifactId>checkstyle</artifactId>\r
+            <version>0.0.1</version>\r
+          </dependency>\r
+        </dependencies>\r
         <configuration>\r
           <failsOnError>true</failsOnError>\r
         <configuration>\r
           <failsOnError>true</failsOnError>\r
-          <configLocation>${project.parent.parent.basedir}/space_and_tabs_checks.xml</configLocation>\r
+          <configLocation>controller/space_and_tabs_checks.xml</configLocation>\r
         </configuration>\r
       </plugin>\r
     </plugins>\r
         </configuration>\r
       </plugin>\r
     </plugins>\r
index 4cd858274950c56e82bbc7a038c6970128e0d58b..031edd0f40570c260d168e205c37b33562394725 100644 (file)
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
         <version>${checkstyle.version}</version>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
         <version>${checkstyle.version}</version>
+        <dependencies>
+          <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>0.0.1</version>
+          </dependency>
+         </dependencies>
         <configuration>
           <failsOnError>true</failsOnError>
         <configuration>
           <failsOnError>true</failsOnError>
-          <configLocation>${project.parent.parent.basedir}/space_and_tabs_checks.xml</configLocation>
+          <configLocation>controller/space_and_tabs_checks.xml</configLocation>
         </configuration>
       </plugin>
       <plugin>
         </configuration>
       </plugin>
       <plugin>
index 33218808a84773e0a6b884eee204a1193763c8c3..e70f5223273db19a344abc65424a8aa1d3364bc3 100644 (file)
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
         <version>${checkstyle.version}</version>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
         <version>${checkstyle.version}</version>
+          <dependencies>
+            <dependency>
+              <groupId>org.opendaylight.controller</groupId>
+              <artifactId>checkstyle</artifactId>
+              <version>0.0.1</version>
+            </dependency>
+          </dependencies>
         <executions>
           <execution>
             <phase>process-sources</phase>
         <executions>
           <execution>
             <phase>process-sources</phase>
         </executions>
         <configuration>
           <failsOnError>true</failsOnError>
         </executions>
         <configuration>
           <failsOnError>true</failsOnError>
-          <configLocation>${project.parent.basedir}/space_and_tabs_checks.xml</configLocation>
+          <configLocation>controller/space_and_tabs_checks.xml</configLocation>
           <consoleOutput>true</consoleOutput>
           <includeTestSourceDirectory>true</includeTestSourceDirectory>
           <sourceDirectory>${project.basedir}</sourceDirectory>
           <consoleOutput>true</consoleOutput>
           <includeTestSourceDirectory>true</includeTestSourceDirectory>
           <sourceDirectory>${project.basedir}</sourceDirectory>
index 97f68785919919445086a0276e42f73bf4cd4326..1833b4ae592fa5867ccb58730dd8a7bb4feccf21 100644 (file)
     <module>../../samples/northbound/loadbalancer</module>
     <module>../../commons/concepts</module>
     <module>../../commons/integrationtest</module>
     <module>../../samples/northbound/loadbalancer</module>
     <module>../../commons/concepts</module>
     <module>../../commons/integrationtest</module>
-
+    <module>../../commons/checkstyle</module>
+    <module>../../commons/opendaylight</module>
   </modules>
 
   <build>
   </modules>
 
   <build>
index 67a473581301ef749a8561dc77945aa5640e24d4..a85c3f8860c45c348ff71cc84caac2fe66ea21d2 100644 (file)
@@ -17,6 +17,7 @@
         <exclude>org.opendaylight.controller:*.integrationtest</exclude>
         <exclude>org.opendaylight.controller:hosttracker_new</exclude>
         <exclude>org.opendaylight.controller:hosttracker_new.implementation</exclude>
         <exclude>org.opendaylight.controller:*.integrationtest</exclude>
         <exclude>org.opendaylight.controller:hosttracker_new</exclude>
         <exclude>org.opendaylight.controller:hosttracker_new.implementation</exclude>
+        <exclude>org.opendaylight.controller:checkstyle</exclude>
       </excludes>
       <binaries>
         <outputDirectory>opendaylight/plugins</outputDirectory>
       </excludes>
       <binaries>
         <outputDirectory>opendaylight/plugins</outputDirectory>