Reduce logged messages during build and concentrate only on the ones 20/2620/1
authorGiovanni Meo <gmeo@cisco.com>
Mon, 11 Nov 2013 17:39:11 +0000 (18:39 +0100)
committerGiovanni Meo <gmeo@cisco.com>
Mon, 11 Nov 2013 18:03:39 +0000 (19:03 +0100)
needed for debugging build errors

- Create a maven artifact that contains a default settings for
logback.xml so it can be reused as dependency to make sure some
plugins don't generate too much verbose output
- Use the artifact
org.opendaylight.controller:commons.logback_settings as UT dependency
so to make sure only in case of errors the follow UT spit messages:
  + netconf-impl
+ config-netconf-connector
- Remove duplicated logback.xml where not needed
- Remove logback.xml and space_and_tabs_checks.xml where no longer needed
- Added logback.xml as a file on the integration tests using pax-exam,
there a local file seems to be required (unfortunately). Make sure the
pax-exam uses it for the tests where not using it.
- Made sure the sanitytest in distribution only runs when
integrationstests profile is selected
- Fixed an issue in importing in eclipse zeromq module
- Excluded all tests from mdsal unless the integrationtests profile is
selected

Signed-off-by: Giovanni Meo <gmeo@cisco.com>
Change-Id: I9c12965bb3de5c8cba1039992cadbe27026bca2a

23 files changed:
opendaylight/clustering/services_implementation/pom.xml
opendaylight/commons/logback_settings/pom.xml [new file with mode: 0644]
opendaylight/commons/logback_settings/src/main/resources/logback.xml [moved from opendaylight/commons/opendaylight/logback.xml with 100% similarity]
opendaylight/commons/opendaylight/pom.xml
opendaylight/commons/parent/logback.xml [deleted file]
opendaylight/commons/parent/space_and_tabs_checks.xml [deleted file]
opendaylight/distribution/opendaylight/pom.xml
opendaylight/hosttracker/implementation/pom.xml
opendaylight/hosttracker/implementation/src/test/resources/logback.xml [deleted file]
opendaylight/hosttracker_new/implementation/pom.xml
opendaylight/hosttracker_new/implementation/src/test/resources/logback.xml [deleted file]
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTest.java
opendaylight/md-sal/sal-binding-it/src/test/resources/logback.xml [moved from opendaylight/statisticsmanager/implementation/src/test/resources/logback.xml with 100% similarity]
opendaylight/md-sal/samples/toaster-it/src/test/java/org/opendaylight/controller/sample/toaster/it/ToasterTest.java
opendaylight/md-sal/samples/toaster-it/src/test/resources/logback.xml [moved from opendaylight/clustering/services_implementation/src/test/resources/logback.xml with 99% similarity]
opendaylight/netconf/config-netconf-connector/pom.xml
opendaylight/netconf/netconf-impl/pom.xml
opendaylight/netconf/netconf-it/pom.xml
opendaylight/statisticsmanager/implementation/pom.xml
opendaylight/switchmanager/implementation/pom.xml
opendaylight/switchmanager/implementation/src/test/resources/logback.xml [deleted file]
pom.xml

index e4bdc21..ab75eb8 100644 (file)
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>commons.logback_settings</artifactId>
+    </dependency>
   </dependencies>
 </project>
diff --git a/opendaylight/commons/logback_settings/pom.xml b/opendaylight/commons/logback_settings/pom.xml
new file mode 100644 (file)
index 0000000..c1ce36e
--- /dev/null
@@ -0,0 +1,17 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>commons.logback_settings</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
+    <tag>HEAD</tag>
+  </scm>
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.parent</artifactId>
+    <version>1.0.1-SNAPSHOT</version>
+    <relativePath>../parent</relativePath>
+  </parent>
+</project>
index f86a0b7..2a81806 100644 (file)
         <artifactId>jolokia-osgi</artifactId>
         <version>${jolokia.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>commons.logback_settings</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+        <scope>test</scope>
+      </dependency>
     </dependencies>
   </dependencyManagement>
 
 
   <build>
     <plugins>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>properties-maven-plugin</artifactId>
-        <version>${propertymavenplugin.version}</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>set-system-properties</goal>
-            </goals>
-            <configuration>
-              <properties>
-                <property>
-                  <name>logback.configurationFile</name>
-                  <value>${project.parent.basedir}/logback.xml</value>
-                </property>
-              </properties>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
-        <artifactId>maven-java-formatter-plugin</artifactId>
-        <version>0.3.1</version>
-        <configuration>
-          <compilerSource>1.6</compilerSource>
-          <compilerCompliance>1.6</compilerCompliance>
-          <compilerTargetPlatform>1.6</compilerTargetPlatform>
-          <configFile>${project.parent.basedir}/sun_coding_style.xml</configFile>
-        </configuration>
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
         <version>${failsafe.version}</version>
         <configuration>
           <argLine>${testvm.argLine}</argLine>
+          <systemProperties>
+            <property>
+              <name>logback.configurationFile</name>
+              <value>logback.xml</value>
+            </property>
+          </systemProperties>
         </configuration>
         <executions>
           <execution>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>${surefire.version}</version>
+        <configuration>
+          <systemProperties>
+            <property>
+              <name>logback.configurationFile</name>
+              <value>logback.xml</value>
+            </property>
+          </systemProperties>
+        </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
               </goals>
             </execution>
           </executions>
+          <dependencies>
+            <dependency>
+              <groupId>org.opendaylight.controller</groupId>
+              <artifactId>commons.logback_settings</artifactId>
+              <version>0.0.1-SNAPSHOT</version>
+            </dependency>
+          </dependencies>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
diff --git a/opendaylight/commons/parent/logback.xml b/opendaylight/commons/parent/logback.xml
deleted file mode 100644 (file)
index 05e6075..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<configuration scan="true">
-
-  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-    <encoder>
-      <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</pattern>
-    </encoder>
-  </appender>
-
-  <root level="error">
-    <appender-ref ref="STDOUT" />
-  </root>
-</configuration>
diff --git a/opendaylight/commons/parent/space_and_tabs_checks.xml b/opendaylight/commons/parent/space_and_tabs_checks.xml
deleted file mode 100644 (file)
index 49a5802..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>\r
-<!DOCTYPE module PUBLIC\r
-    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"\r
-    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">\r
-\r
-<module name="Checker">\r
-    <module name="FileTabCharacter">\r
-        <property name="eachLine" value="true"/>\r
-    </module>\r
-\r
-    <module name="RegexpSingleline">\r
-        <!-- \s matches whitespace character, $ matches end of line. -->\r
-        <property name="format" value="\s+$"/>\r
-        <property name="message" value="Line has trailing spaces."/>\r
-    </module>\r
-\r
-</module>\r
index 1ebab9b..9120c84 100644 (file)
         </dependency>
       </dependencies>
     </profile>
+    <profile>
+      <id>integrationtests</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>2.8</version>
+            <executions>
+              <execution>
+                <id>copy</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>copy</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>org.opendaylight.controller</groupId>
+                  <artifactId>sanitytest</artifactId>
+                  <version>${controller.version}</version>
+                  <type>jar</type>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </plugin>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.2.1</version>
+            <executions>
+              <execution>
+                <id>sanity-test</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>exec</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <executable>${java.home}/bin/java</executable>
+              <arguments>
+                <argument>-cp</argument>
+                <argument>./target/dependency/*</argument>
+                <argument>org.opendaylight.controller.distribution.Sanity</argument>
+              </arguments>
+              <environmentVariables>
+                <JAVA_HOME>
+                  ${java.home}
+                </JAVA_HOME>
+              </environmentVariables>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 
   <artifactId>distribution.opendaylight</artifactId>
           </execution>
         </executions>
       </plugin>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <version>2.8</version>
-          <executions>
-            <execution>
-              <id>copy</id>
-              <phase>package</phase>
-              <goals>
-                <goal>copy</goal>
-              </goals>
-            </execution>
-          </executions>
-          <configuration>
-            <artifactItems>
-              <artifactItem>
-                <groupId>org.opendaylight.controller</groupId>
-                <artifactId>sanitytest</artifactId>
-                <version>${controller.version}</version>
-                <type>jar</type>
-              </artifactItem>
-            </artifactItems>
-          </configuration>
-      </plugin>
-
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>exec-maven-plugin</artifactId>
-        <version>1.2.1</version>
-        <executions>
-          <execution>
-            <id>sanity-test</id>
-            <phase>package</phase>
-            <goals>
-              <goal>exec</goal>
-            </goals>
-          </execution>
-        </executions>
-          <configuration>
-            <executable>${java.home}/bin/java</executable>
-            <arguments>
-                <argument>-cp</argument>
-                <argument>./target/dependency/*</argument>
-                <argument>org.opendaylight.controller.distribution.Sanity</argument>
-            </arguments>
-            <environmentVariables>
-              <JAVA_HOME>
-                ${java.home}
-              </JAVA_HOME>
-            </environmentVariables>
-          </configuration>
-      </plugin>
     </plugins>
   </build>
 </project>
index 241f926..6faf2e9 100644 (file)
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>commons.logback_settings</artifactId>
+    </dependency>
   </dependencies>
 </project>
diff --git a/opendaylight/hosttracker/implementation/src/test/resources/logback.xml b/opendaylight/hosttracker/implementation/src/test/resources/logback.xml
deleted file mode 100644 (file)
index 5fa21fe..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<configuration scan="true">\r
-\r
-  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
-    <encoder>\r
-      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n\r
-      </pattern>\r
-    </encoder>\r
-  </appender>\r
-\r
-  <root level="error">\r
-    <appender-ref ref="STDOUT" />\r
-  </root>\r
-</configuration>\r
index 99760a6..0405d45 100644 (file)
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>commons.logback_settings</artifactId>
+    </dependency>
   </dependencies>
 </project>
diff --git a/opendaylight/hosttracker_new/implementation/src/test/resources/logback.xml b/opendaylight/hosttracker_new/implementation/src/test/resources/logback.xml
deleted file mode 100644 (file)
index 5fa21fe..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<configuration scan="true">\r
-\r
-  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
-    <encoder>\r
-      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n\r
-      </pattern>\r
-    </encoder>\r
-  </appender>\r
-\r
-  <root level="error">\r
-    <appender-ref ref="STDOUT" />\r
-  </root>\r
-</configuration>\r
index fd89da4..1ff7f2d 100644 (file)
@@ -49,7 +49,6 @@
         <module>compatibility</module>
 
         <module>sal-zeromq-connector</module>
-        <module>test</module>
     </modules>
 
 
@@ -62,6 +61,7 @@
             <modules>
                 <module>sal-binding-it</module>
                 <module>clustered-data-store/integrationtest</module>
+                <module>test</module>
             </modules>
         </profile>
     </profiles>
     <build>
         <pluginManagement>
             <plugins>
-                <!--This plugin's configuration is used to store Eclipse
-                    m2e settings only. It has no influence on the Maven build itself. -->
-                <plugin>
-                    <groupId>org.eclipse.m2e</groupId>
-                    <artifactId>lifecycle-mapping</artifactId>
-                    <version>1.0.0</version>
-                    <configuration>
-                        <lifecycleMappingMetadata>
-                            <pluginExecutions>
-                                <pluginExecution>
-                                  <pluginExecutionFilter>
-                                    <groupId>org.jacoco</groupId>
-                                    <artifactId>jacoco-maven-plugin</artifactId>
-                                    <versionRange>[0.0,)</versionRange>
-                                    <goals>
-                                      <goal>prepare-agent</goal>
-                                      <goal>pre-test</goal>
-                                      <goal>post-test</goal>
-                                    </goals>
-                                  </pluginExecutionFilter>
-                                  <action>
-                                    <ignore />
-                                  </action>
-                                </pluginExecution>
-                            </pluginExecutions>
-                        </lifecycleMappingMetadata>
-                    </configuration>
-                </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-release-plugin</artifactId>
                             <pluginExecutions>
                                 <pluginExecution>
                                     <pluginExecutionFilter>
-                                        <groupId>
-                                            org.opendaylight.yangtools
-                                        </groupId>
-                                        <artifactId>
-                                            yang-maven-plugin
-                                        </artifactId>
-                                        <versionRange>
-                                            [0.5,)
-                                        </versionRange>
+                                        <groupId>org.opendaylight.yangtools</groupId>
+                                        <artifactId>yang-maven-plugin</artifactId>
+                                        <versionRange>[0,)</versionRange>
+                                        <goals>
+                                            <goal>generate-sources</goal>
+                                        </goals>
+                                    </pluginExecutionFilter>
+                                    <action>
+                                        <ignore/>
+                                    </action>
+                                </pluginExecution>
+                                <pluginExecution>
+                                    <pluginExecutionFilter>
+                                        <groupId>net.alchim31.maven</groupId>
+                                        <artifactId>scala-maven-plugin</artifactId>
+                                        <versionRange>[0,)</versionRange>
                                         <goals>
-                                            <goal>
-                                                generate-sources
-                                            </goal>
+                                            <goal>compile</goal>
+                                            <goal>testCompile</goal>
                                         </goals>
                                     </pluginExecutionFilter>
                                     <action>
-                                        <ignore></ignore>
+                                      <ignore/>
                                     </action>
                                 </pluginExecution>
                                 <pluginExecution>
                                     <pluginExecutionFilter>
                                         <groupId>org.jacoco</groupId>
-                                        <artifactId>
-                                            jacoco-maven-plugin
-                                        </artifactId>
-                                        <versionRange>
-                                            [0.5.3.201107060350,)
-                                        </versionRange>
+                                        <artifactId>jacoco-maven-plugin</artifactId>
+                                        <versionRange>[0,)</versionRange>
                                         <goals>
                                             <goal>prepare-agent</goal>
                                         </goals>
                                     </pluginExecutionFilter>
                                     <action>
-                                        <ignore></ignore>
+                                        <ignore/>
                                     </action>
                                 </pluginExecution>
                             </pluginExecutions>
index 4057d9d..41b1e31 100644 (file)
@@ -11,6 +11,7 @@ import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
 import org.ops4j.pax.exam.options.DefaultCompositeOption;
+import org.ops4j.pax.exam.util.PathUtils;
 import org.osgi.framework.BundleContext;
 
 @RunWith(PaxExam.class)
@@ -48,6 +49,9 @@ public abstract class AbstractTest {
     public Option[] config() {
         return options(systemProperty("osgi.console").value("2401"), mavenBundle("org.slf4j", "slf4j-api")
                 .versionAsInProject(), //
+                systemProperty("logback.configurationFile").value(
+                        "file:" + PathUtils.getBaseDir()
+                                + "/src/test/resources/logback.xml"),
                 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
                 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
                 mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(), //
index 7cd4fa5..02d8231 100644 (file)
@@ -17,6 +17,7 @@ import static org.ops4j.pax.exam.CoreOptions.junitBundles;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import org.ops4j.pax.exam.util.PathUtils;
 
 @RunWith(PaxExam.class)
 public class ToasterTest {
@@ -46,6 +47,9 @@ public class ToasterTest {
     @Configuration
     public Option[] config() {
         return options(systemProperty("osgi.console").value("2401"), 
+                systemProperty("logback.configurationFile").value(
+                    "file:" + PathUtils.getBaseDir()
+                    + "/src/test/resources/logback.xml"),
                 mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(), //
                 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(), //
                 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(), //
@@ -1,4 +1,5 @@
 <configuration scan="true">
+
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <encoder>
       <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
index 74c08e3..d855f15 100755 (executable)
             <version>${bgpcep.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>commons.logback_settings</artifactId>
+        </dependency>
     </dependencies>
 
     <build>
index 028e9b4..33fa675 100644 (file)
             <artifactId>netconf-client</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>commons.logback_settings</artifactId>
+        </dependency>
     </dependencies>
 
     <build>
index 8606421..13b0a1e 100644 (file)
             <artifactId>mockito-configuration</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+          <groupId>org.opendaylight.controller</groupId>
+          <artifactId>commons.logback_settings</artifactId>
+        </dependency>
     </dependencies>
 
     <build>
index 7281b9a..54ba486 100644 (file)
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>commons.logback_settings</artifactId>
+    </dependency>
   </dependencies>
 </project>
index 1a787c7..1e78ec7 100644 (file)
       <artifactId>junit</artifactId>
     </dependency>
     <dependency>
-        <groupId>equinoxSDK381</groupId>
-        <artifactId>org.apache.felix.gogo.runtime</artifactId>
+      <groupId>equinoxSDK381</groupId>
+      <artifactId>org.apache.felix.gogo.runtime</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>commons.logback_settings</artifactId>
     </dependency>
   </dependencies>
 </project>
diff --git a/opendaylight/switchmanager/implementation/src/test/resources/logback.xml b/opendaylight/switchmanager/implementation/src/test/resources/logback.xml
deleted file mode 100644 (file)
index 5fa21fe..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<configuration scan="true">\r
-\r
-  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
-    <encoder>\r
-      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n\r
-      </pattern>\r
-    </encoder>\r
-  </appender>\r
-\r
-  <root level="error">\r
-    <appender-ref ref="STDOUT" />\r
-  </root>\r
-</configuration>\r
diff --git a/pom.xml b/pom.xml
index b95cdfd..c603a94 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <module>opendaylight/commons/checkstyle</module>
     <module>opendaylight/commons/opendaylight</module>
     <module>opendaylight/commons/parent</module>
+    <module>opendaylight/commons/logback_settings</module>
   </modules>
 
     <profiles>