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 9f3107d..fb8d9c1 100644 (file)
         <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
-          <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
index 4cd8582..031edd0 100644 (file)
         <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>
-          <configLocation>${project.parent.parent.basedir}/space_and_tabs_checks.xml</configLocation>
+          <configLocation>controller/space_and_tabs_checks.xml</configLocation>
         </configuration>
       </plugin>
       <plugin>
index 3321880..e70f522 100644 (file)
         <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>
         <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>
index 97f6878..1833b4a 100644 (file)
     <module>../../samples/northbound/loadbalancer</module>
     <module>../../commons/concepts</module>
     <module>../../commons/integrationtest</module>
-
+    <module>../../commons/checkstyle</module>
+    <module>../../commons/opendaylight</module>
   </modules>
 
   <build>
index 67a4735..a85c3f8 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:checkstyle</exclude>
       </excludes>
       <binaries>
         <outputDirectory>opendaylight/plugins</outputDirectory>

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.