From f573d0f163f1a12fc334291ce7f2e0ce497eab03 Mon Sep 17 00:00:00 2001 From: Lorand Jakab Date: Tue, 28 Jun 2016 16:25:06 -0500 Subject: [PATCH] Checkstyle: preparation for switching to odlparent There has been a lot of work on the ODL-wide checkstyle rules in odlparent, and we should eventually be compliant. To be able to make progress on individial bundles, this commit moves our custom checkstyle enabler from mappingservice/pom.xml to the individual child poms. As an example, mappingservice/shell is updated to comply with ODL checkstyle rules and turns on enforcement. Additionally, it contains a violation that is inevitable, and code to suppress than one particular violation. That can be used as an example in other places where there is good reason not to follow ODL style. Change-Id: I3455f4084fa1302f8a970b2dfba0b9293767aecf Signed-off-by: Lorand Jakab --- mappingservice/api/pom.xml | 34 +++++++++++++++++++ mappingservice/dsbackend/pom.xml | 34 +++++++++++++++++++ mappingservice/implementation/pom.xml | 34 +++++++++++++++++++ mappingservice/inmemorydb/pom.xml | 34 +++++++++++++++++++ mappingservice/mapcache/pom.xml | 34 +++++++++++++++++++ mappingservice/pom.xml | 34 ------------------- mappingservice/shell/pom.xml | 13 +++++++ .../lispflowmapping/shell/LispAddKey.java | 4 +-- .../lispflowmapping/shell/LispMappings.java | 5 +-- mappingservice/southbound/pom.xml | 34 +++++++++++++++++++ 10 files changed, 222 insertions(+), 38 deletions(-) diff --git a/mappingservice/api/pom.xml b/mappingservice/api/pom.xml index 45e49931b..496fd1154 100644 --- a/mappingservice/api/pom.xml +++ b/mappingservice/api/pom.xml @@ -27,6 +27,40 @@ + + + + + + maven-checkstyle-plugin + + checkstyle/java_rules.xml + true + org/opendaylight/yang/gen/**,**/config/yang/** + true + true + + + + org.opendaylight.lispflowmapping + common.build.tools + ${project.version} + + + + + + check + + process-sources + + + + + + + + maven-checkstyle-plugin + + checkstyle/java_rules.xml + true + org/opendaylight/yang/gen/**,**/config/yang/** + true + true + + + + org.opendaylight.lispflowmapping + common.build.tools + ${project.version} + + + + + + check + + process-sources + + + + + + + + maven-checkstyle-plugin + + checkstyle/java_rules.xml + true + org/opendaylight/yang/gen/**,**/config/yang/** + true + true + + + + org.opendaylight.lispflowmapping + common.build.tools + ${project.version} + + + + + + check + + process-sources + + + + + + + + maven-checkstyle-plugin + + checkstyle/java_rules.xml + true + org/opendaylight/yang/gen/**,**/config/yang/** + true + true + + + + org.opendaylight.lispflowmapping + common.build.tools + ${project.version} + + + + + + check + + process-sources + + + + + + + + maven-checkstyle-plugin + + checkstyle/java_rules.xml + true + org/opendaylight/yang/gen/**,**/config/yang/** + true + true + + + + org.opendaylight.lispflowmapping + common.build.tools + ${project.version} + + + + + + check + + process-sources + + + + + + + - maven-checkstyle-plugin - - checkstyle/java_rules.xml - true - org/opendaylight/yang/gen/**,**/config/yang/** - true - true - - - - org.opendaylight.lispflowmapping - common.build.tools - ${project.version} - - - - - - check - - process-sources - - - - - - - + org.apache.maven.plugins + maven-checkstyle-plugin + + true + checkstyle.violationSeverity=error + + + + org.apache.felix diff --git a/mappingservice/shell/src/main/java/org/opendaylight/lispflowmapping/shell/LispAddKey.java b/mappingservice/shell/src/main/java/org/opendaylight/lispflowmapping/shell/LispAddKey.java index a37464042..77167967b 100644 --- a/mappingservice/shell/src/main/java/org/opendaylight/lispflowmapping/shell/LispAddKey.java +++ b/mappingservice/shell/src/main/java/org/opendaylight/lispflowmapping/shell/LispAddKey.java @@ -13,12 +13,12 @@ import org.apache.karaf.shell.console.OsgiCommandSupport; import org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingServiceShell; /** - * This class implements the "lisp:addkey" Karaf shell command + * This class implements the "lisp:addkey" Karaf shell command. * * @author Lorand Jakab * */ -@Command(scope = "mappingservice", name = "addkey", description="Add an authentication key") +@Command(scope = "mappingservice", name = "addkey", description = "Add an authentication key") public class LispAddKey extends OsgiCommandSupport { private IMappingServiceShell mappingServiceShell; diff --git a/mappingservice/shell/src/main/java/org/opendaylight/lispflowmapping/shell/LispMappings.java b/mappingservice/shell/src/main/java/org/opendaylight/lispflowmapping/shell/LispMappings.java index e84bbd350..4e44795cd 100644 --- a/mappingservice/shell/src/main/java/org/opendaylight/lispflowmapping/shell/LispMappings.java +++ b/mappingservice/shell/src/main/java/org/opendaylight/lispflowmapping/shell/LispMappings.java @@ -13,16 +13,17 @@ import org.apache.karaf.shell.console.OsgiCommandSupport; import org.opendaylight.lispflowmapping.interfaces.mappingservice.IMappingServiceShell; /** - * This class implements the "lisp:mappings" Karaf shell command + * This class implements the "lisp:mappings" Karaf shell command. * * @author Lorand Jakab * */ -@Command(scope = "mappingservice", name = "mappings", description="Print LISP mapping database") +@Command(scope = "mappingservice", name = "mappings", description = "Print LISP mapping database") public class LispMappings extends OsgiCommandSupport { private IMappingServiceShell mappingServiceShell; @Override + @SuppressWarnings("checkstyle:RegexpMultiline") protected Object doExecute() throws Exception { System.out.print(mappingServiceShell.printMappings()); return null; diff --git a/mappingservice/southbound/pom.xml b/mappingservice/southbound/pom.xml index 048b91c10..575e4f34e 100644 --- a/mappingservice/southbound/pom.xml +++ b/mappingservice/southbound/pom.xml @@ -53,6 +53,40 @@ + + + + + + maven-checkstyle-plugin + + checkstyle/java_rules.xml + true + org/opendaylight/yang/gen/**,**/config/yang/** + true + true + + + + org.opendaylight.lispflowmapping + common.build.tools + ${project.version} + + + + + + check + + process-sources + + + + + + +