From a0a282e48fe650bbc24d5469a9bc125f82752064 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 13 Jan 2017 19:32:36 +0000 Subject: [PATCH 01/10] pom.xml: set build source and output encoding to UTF-8 --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 293a289..f22b473 100644 --- a/pom.xml +++ b/pom.xml @@ -12,6 +12,11 @@ Kemitix Checkstyle Ruleset (Parent) Parent POM for the Kemitix Checkstyle Ruleset and it's Builder + + UTF-8 + UTF-8 + + builder ruleset From c254afcca765f65742233c20a77c659ae5a3c828 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 13 Jan 2017 19:34:51 +0000 Subject: [PATCH 02/10] builder:pom.xml: clean up --- builder/pom.xml | 49 +++++++++---------- .../ruleset/builder/RulesProperties.java | 2 - 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/builder/pom.xml b/builder/pom.xml index e7c2116..9099d57 100644 --- a/builder/pom.xml +++ b/builder/pom.xml @@ -34,9 +34,12 @@ 2016 + 1.8 + UTF-8 + UTF-8 1.4.3.RELEASE 2.0.0-SNAPSHOT - 5-complexity + 1.16.12 3.6.1 2.3.4 1.0.0 @@ -66,6 +69,8 @@ org.projectlombok lombok + ${lombok.version} + provided com.speedment.common @@ -81,6 +86,7 @@ org.assertj assertj-core ${assertj.version} + test me.andrz @@ -90,35 +96,28 @@ - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${maven.checkstyle.plugin.version} - - net/kemitix/checkstyle-${kemitix-checkstyle-ruleset.level}.xml - - - - + + net.kemitix + kemitix-checkstyle-ruleset-maven-plugin + ${kemitix-checkstyle-ruleset.version} + org.springframework.boot spring-boot-maven-plugin ${spring-boot.version} - - - - - - - - - - - - + + true + + + + + + repackage + + + + org.eluder.coveralls diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RulesProperties.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RulesProperties.java index 6abb1e8..5eee953 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RulesProperties.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/RulesProperties.java @@ -25,7 +25,6 @@ SOFTWARE. package net.kemitix.checkstyle.ruleset.builder; import lombok.Getter; -import lombok.extern.slf4j.Slf4j; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; @@ -37,7 +36,6 @@ import java.util.List; * * @author Paul Campbell (pcampbell@kemitix.net) */ -@Slf4j @Getter @Configuration @ConfigurationProperties From dc639da079d308350189003c5757df9726c4293b Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 13 Jan 2017 19:36:07 +0000 Subject: [PATCH 03/10] plugin: added --- README.md | 73 +++------ builder/src/main/resources/README-template.md | 73 +++------ plugin/LICENSE.txt | 23 +++ plugin/pom.xml | 95 +++++++++++ .../checkstyle/ruleset/plugin/CheckMojo.java | 150 ++++++++++++++++++ .../ruleset/plugin/package-info.java | 31 ++++ pom.xml | 1 + 7 files changed, 342 insertions(+), 104 deletions(-) create mode 100644 plugin/LICENSE.txt create mode 100644 plugin/pom.xml create mode 100644 plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/CheckMojo.java create mode 100644 plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/package-info.java diff --git a/README.md b/README.md index 919171e..075df53 100644 --- a/README.md +++ b/README.md @@ -22,76 +22,45 @@ The ruleset includes checks from both the core Checkstyle library and from the S ## Usage -To use this ruleset in your `maven-checkstyle-plugin` configuration add `checkstyle`, `sevntu-checkstyle-maven-plugin` and `kemitix-checktyle-ruleset` as dependencies of the `maven-checkstyle-plugin`. +To use this ruleset add the plugin `kemitix-checktyle-ruleset-maven-plugin`. +The `maven-checkstyle-plugin` will be included automatically. -You need to include `checkstyle` as the version bundled with the `maven-checkstyle-plugin` is not up-to-date enough. +Select the level 1-5 of strictness required: -Select the `configLocation` for the level of strictness required: - -* checkstyle-1-layout.xml -* checkstyle-2-naming.xml -* checkstyle-3-javadoc.xml -* checkstyle-4-tweaks.xml -* checkstyle-5-complexity.xml - -Only specify a single `configLocation` as each increasing level includes all the rules -from the previous. +1. layout +2. naming +3. javadoc +4. tweaks +5. complexity ```` - 2.17 - 7.3 - 1.22.0 - 2.0.0 - 5-complexity + 2 + - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${maven.checkstyle.plugin.version} - - - com.puppycrawl.tools - checkstyle - ${checkstyle.version} - - - com.github.sevntu.checkstyle - sevntu-checkstyle-maven-plugin - ${sevntu-checkstyle-maven-plugin.version} - - - net.kemitix - kemitix-checkstyle-ruleset - ${kemitix-checkstyle-ruleset.version} - - - - net/kemitix/checkstyle-${kemitix-checkstyle-ruleset.level}.xml - - - - - org.apache.maven.plugins - maven-checkstyle-plugin + net.kemitix + kemitix-checkstyle-ruleset-maven-plugin + 2.0.0 + + ${kemitix-checkstyle-ruleset.level} + - validate validate - check - checkstyle + + check + - + + sevntu-maven diff --git a/builder/src/main/resources/README-template.md b/builder/src/main/resources/README-template.md index 528c337..aff6d61 100644 --- a/builder/src/main/resources/README-template.md +++ b/builder/src/main/resources/README-template.md @@ -22,76 +22,45 @@ The ruleset includes checks from both the core Checkstyle library and from the S ## Usage -To use this ruleset in your `maven-checkstyle-plugin` configuration add `checkstyle`, `sevntu-checkstyle-maven-plugin` and `kemitix-checktyle-ruleset` as dependencies of the `maven-checkstyle-plugin`. +To use this ruleset add the plugin `kemitix-checktyle-ruleset-maven-plugin`. +The `maven-checkstyle-plugin` will be included automatically. -You need to include `checkstyle` as the version bundled with the `maven-checkstyle-plugin` is not up-to-date enough. +Select the level 1-5 of strictness required: -Select the `configLocation` for the level of strictness required: - -* checkstyle-1-layout.xml -* checkstyle-2-naming.xml -* checkstyle-3-javadoc.xml -* checkstyle-4-tweaks.xml -* checkstyle-5-complexity.xml - -Only specify a single `configLocation` as each increasing level includes all the rules -from the previous. +1. layout +2. naming +3. javadoc +4. tweaks +5. complexity ```` - 2.17 - 7.3 - 1.22.0 - 2.0.0 - 5-complexity + 2 + - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${maven.checkstyle.plugin.version} - - - com.puppycrawl.tools - checkstyle - ${checkstyle.version} - - - com.github.sevntu.checkstyle - sevntu-checkstyle-maven-plugin - ${sevntu-checkstyle-maven-plugin.version} - - - net.kemitix - kemitix-checkstyle-ruleset - ${kemitix-checkstyle-ruleset.version} - - - - net/kemitix/checkstyle-${kemitix-checkstyle-ruleset.level}.xml - - - - - org.apache.maven.plugins - maven-checkstyle-plugin + net.kemitix + kemitix-checkstyle-ruleset-maven-plugin + 2.0.0 + + ${kemitix-checkstyle-ruleset.level} + - validate validate - check - checkstyle + + check + - + + sevntu-maven diff --git a/plugin/LICENSE.txt b/plugin/LICENSE.txt new file mode 100644 index 0000000..00c515a --- /dev/null +++ b/plugin/LICENSE.txt @@ -0,0 +1,23 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Paul Campbell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ diff --git a/plugin/pom.xml b/plugin/pom.xml new file mode 100644 index 0000000..170d052 --- /dev/null +++ b/plugin/pom.xml @@ -0,0 +1,95 @@ + + + 4.0.0 + + + net.kemitix + kemitix-parent + 2.2.0 + + + + kemitix-checkstyle-ruleset-maven-plugin + + maven-plugin + Kemitix Checkstyle Ruleset Maven Plugin + Checkstyle configuration using the Kemitix Checkstyle Ruleset + + + 1.8 + UTF-8 + UTF-8 + 3.3.9 + 3.5 + 3.5 + 2.17 + 7.3 + 1.23.0 + 2.0.0-SNAPSHOT + 2.2.0 + 1.16.12 + 1.0.0 + + + + + org.apache.maven + maven-plugin-api + ${maven.version} + + + org.apache.maven + maven-core + ${maven.version} + + + org.apache.maven.plugin-tools + maven-plugin-annotations + ${maven-plugin-annotations.version} + provided + + + org.twdata.maven + mojo-executor + ${mojo-executor.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + + me.andrz + map-builder + ${map-builder.version} + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + ${maven-plugin-plugin.version} + + + help-goal + + helpmojo + + + + + + + + + sevntu-maven + sevntu-maven + http://sevntu-checkstyle.github.io/sevntu.checkstyle/maven2 + + + diff --git a/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/CheckMojo.java b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/CheckMojo.java new file mode 100644 index 0000000..eca0617 --- /dev/null +++ b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/CheckMojo.java @@ -0,0 +1,150 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Paul Campbell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +package net.kemitix.checkstyle.ruleset.plugin; + +import lombok.Setter; +import lombok.val; +import me.andrz.builder.map.MapBuilder; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.BuildPluginManager; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; +import org.twdata.maven.mojoexecutor.MojoExecutor; + +import java.util.Map; + +/** + * Runs the Checkstyle Maven Plugin with the Kemitix Checkstyle Ruleset. + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ +@Mojo(name = "check", defaultPhase = LifecyclePhase.VALIDATE) +public class CheckMojo extends AbstractMojo { + + private static final String CHECKSTYLE_GROUPID = "com.puppycrawl.tools"; + + private static final String CHECKSTYLE_ARTIFACTID = "checkstyle"; + + private static final String SEVNTU_GROUPID = "com.github.sevntu.checkstyle"; + + private static final String SEVNTU_ARTIFACTID = "sevntu-checkstyle-maven-plugin"; + + private static final String KEMITIX_GROUPID = "net.kemitix"; + + private static final String KEMITIX_ARTIFACTID = "kemitix-checkstyle-ruleset"; + + private static final String APACHE_PLUGIN_GROUPID = "org.apache.maven.plugins"; + + private static final String APACHE_PLUGIN_ARTIFACTID = "maven-checkstyle-plugin"; + + private static final String CONFIG_LOCATION = "configLocation"; + + + private static final String LAYOUT = "1-layout"; + + private static final String NAMING = "2-naming"; + + private static final String JAVADOC = "3-javadoc"; + + private static final String TWEAKS = "4-tweaks"; + + private static final String COMPLEXITY = "5-complexity"; + + private static Map levelConfig = new MapBuilder().put("1", LAYOUT) + .put("2", NAMING) + .put("3", JAVADOC) + .put("4", TWEAKS) + .put("5", COMPLEXITY) + .build(); + + //@Setter + //@Parameter(defaultValue = "check") + //private String goal; + + @Setter + @Parameter(defaultValue = "2.17") + private String mavenCheckstylePluginVersion; + + @Setter + @Parameter(defaultValue = "7.3") + private String checkstyleVersion; + + @Setter + @Parameter(defaultValue = "1.23.0") + private String sevntuVersion; + + @Setter + @Parameter(defaultValue = "2.0.0-SNAPSHOT") + private String rulesetVersion; + + @Setter + @Parameter(defaultValue = "5") + private String level; + + @Setter + @Parameter(defaultValue = "${project}", readonly = true) + private MavenProject mavenProject; + + @Setter + @Parameter(defaultValue = "${session}", readonly = true) + private MavenSession mavenSession; + + @Component + private BuildPluginManager pluginManager; + + private static String getConfigFile(final String level) { + return String.format("checkstyle-%s.xml", levelConfig.getOrDefault(level, COMPLEXITY)); + } + + /** + * Execute Checkstyle Check. + * + * @throws MojoExecutionException on execution error + * @throws MojoFailureException on execution failure + */ + public final void execute() throws MojoExecutionException, MojoFailureException { + val checkstyle = MojoExecutor.dependency(CHECKSTYLE_GROUPID, CHECKSTYLE_ARTIFACTID, checkstyleVersion); + val sevntu = MojoExecutor.dependency(SEVNTU_GROUPID, SEVNTU_ARTIFACTID, sevntuVersion); + val ruleset = MojoExecutor.dependency(KEMITIX_GROUPID, KEMITIX_ARTIFACTID, rulesetVersion); + val checkstylePlugin = + MojoExecutor.plugin(APACHE_PLUGIN_GROUPID, APACHE_PLUGIN_ARTIFACTID, mavenCheckstylePluginVersion, + MojoExecutor.dependencies(checkstyle, sevntu, ruleset) + ); + val configLocation = MojoExecutor.element(CONFIG_LOCATION, "net/kemitix/" + getConfigFile(level)); + + getLog().info( + "Running Checkstyle " + checkstyleVersion + " (sevntu: " + sevntuVersion + ") with " + getConfigFile( + level)); + MojoExecutor.executeMojo(checkstylePlugin, "check", MojoExecutor.configuration(configLocation), + MojoExecutor.executionEnvironment(mavenProject, mavenSession, pluginManager) + ); + } +} diff --git a/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/package-info.java b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/package-info.java new file mode 100644 index 0000000..af77c05 --- /dev/null +++ b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/package-info.java @@ -0,0 +1,31 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Paul Campbell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +/** + * . + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ + +package net.kemitix.checkstyle.ruleset.plugin; diff --git a/pom.xml b/pom.xml index f22b473..9bb1965 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,7 @@ builder ruleset + plugin From a67d23b90a5548aeb02747ff652d6a1142a5d702 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 13 Jan 2017 19:36:21 +0000 Subject: [PATCH 04/10] plugin-sample: added --- plugin-sample/LICENSE.txt | 23 +++++++++ plugin-sample/pom.xml | 49 +++++++++++++++++++ .../net/kemitix/checkstyle/sample/Sample.java | 38 ++++++++++++++ pom.xml | 1 + 4 files changed, 111 insertions(+) create mode 100644 plugin-sample/LICENSE.txt create mode 100644 plugin-sample/pom.xml create mode 100644 plugin-sample/src/main/java/net/kemitix/checkstyle/sample/Sample.java diff --git a/plugin-sample/LICENSE.txt b/plugin-sample/LICENSE.txt new file mode 100644 index 0000000..00c515a --- /dev/null +++ b/plugin-sample/LICENSE.txt @@ -0,0 +1,23 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Paul Campbell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ diff --git a/plugin-sample/pom.xml b/plugin-sample/pom.xml new file mode 100644 index 0000000..927b4d2 --- /dev/null +++ b/plugin-sample/pom.xml @@ -0,0 +1,49 @@ + + + + 4.0.0 + + + net.kemitix + kemitix-checkstyle-ruleset-plugin-sample + 2.0.0-SNAPSHOT + + + + UTF-8 + UTF-8 + + + + + + net.kemitix + kemitix-checkstyle-ruleset-maven-plugin + 2.0.0-SNAPSHOT + + 2 + + + + validate + + + check + + + + + + + + + + + sevntu-maven + sevntu-maven + http://sevntu-checkstyle.github.io/sevntu.checkstyle/maven2 + + + diff --git a/plugin-sample/src/main/java/net/kemitix/checkstyle/sample/Sample.java b/plugin-sample/src/main/java/net/kemitix/checkstyle/sample/Sample.java new file mode 100644 index 0000000..9f7eaba --- /dev/null +++ b/plugin-sample/src/main/java/net/kemitix/checkstyle/sample/Sample.java @@ -0,0 +1,38 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Paul Campbell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +package net.kemitix.checkstyle.sample; + +/** + * Sample class to test the Kemitix Checkstyle Ruleset Maven Plugin against. + * + * @author Paul Campbell (paul.campbell@hubio.com) + */ +public class Sample { + + + public static void main(String[] args) { + System.out.println("Sample!"); + } +} diff --git a/pom.xml b/pom.xml index 9bb1965..f759f57 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,7 @@ builder ruleset plugin + plugin-sample From 5a259aa0509db803bf247276fa9d383e49fa461e Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 14 Jan 2017 10:18:07 +0000 Subject: [PATCH 05/10] plugin:pom.xml: set version, don't inherit it Parent has been changed so need to set version explicitly. --- plugin/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/pom.xml b/plugin/pom.xml index 170d052..af662a5 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -12,6 +12,7 @@ kemitix-checkstyle-ruleset-maven-plugin + 2.0.0-SNAPSHOT maven-plugin Kemitix Checkstyle Ruleset Maven Plugin From 9ce647d769bc70ca40c3eac522d3c0264509222a Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 14 Jan 2017 16:17:04 +0000 Subject: [PATCH 06/10] plugin:pom.xml: remove kemitix-parent to avoid cyclic dependency kemitix-parent will include this plugin, so we can't have it as our parent. --- plugin/pom.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugin/pom.xml b/plugin/pom.xml index af662a5..5af39ab 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -6,14 +6,11 @@ net.kemitix - kemitix-parent - 2.2.0 - + kemitix-checkstyle-ruleset-parent + 2.0.0-SNAPSHOT kemitix-checkstyle-ruleset-maven-plugin - 2.0.0-SNAPSHOT - maven-plugin Kemitix Checkstyle Ruleset Maven Plugin Checkstyle configuration using the Kemitix Checkstyle Ruleset From 1380fb54ae902cdd90a4fac10a902061a45be46c Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 14 Jan 2017 16:34:50 +0000 Subject: [PATCH 07/10] plugin:pom.xml: add maven-compiler-plugin --- plugin/pom.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugin/pom.xml b/plugin/pom.xml index 5af39ab..9fb4d97 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -20,6 +20,7 @@ UTF-8 UTF-8 3.3.9 + 3.6.0 3.5 3.5 2.17 @@ -81,6 +82,20 @@ + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + -Xlint:unchecked + + true + true + 1.8 + 1.8 + + From 3bed524b2730428d782bf5f9ef1e7c0941c9fa4e Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 14 Jan 2017 16:35:25 +0000 Subject: [PATCH 08/10] plugin: remove redundant properties --- plugin/pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugin/pom.xml b/plugin/pom.xml index 9fb4d97..62f63f2 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -23,10 +23,6 @@ 3.6.0 3.5 3.5 - 2.17 - 7.3 - 1.23.0 - 2.0.0-SNAPSHOT 2.2.0 1.16.12 1.0.0 From 67557955ccf12255c0549da49922c73f5d477948 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 14 Jan 2017 17:04:18 +0000 Subject: [PATCH 09/10] plugin: provide goals for each ruleset level --- README.md | 24 ++++------ builder/src/main/resources/README-template.md | 24 ++++------ plugin-sample/pom.xml | 7 +-- ...{CheckMojo.java => AbstractCheckMojo.java} | 48 +++---------------- .../ruleset/plugin/ComplexityCheckMojo.java | 44 +++++++++++++++++ .../ruleset/plugin/JavadocCheckMojo.java | 44 +++++++++++++++++ .../ruleset/plugin/LayoutCheckMojo.java | 44 +++++++++++++++++ .../ruleset/plugin/NamingCheckMojo.java | 44 +++++++++++++++++ .../ruleset/plugin/TweaksCheckMojo.java | 44 +++++++++++++++++ 9 files changed, 248 insertions(+), 75 deletions(-) rename plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/{CheckMojo.java => AbstractCheckMojo.java} (69%) create mode 100644 plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/ComplexityCheckMojo.java create mode 100644 plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/JavadocCheckMojo.java create mode 100644 plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/LayoutCheckMojo.java create mode 100644 plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/NamingCheckMojo.java create mode 100644 plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/TweaksCheckMojo.java diff --git a/README.md b/README.md index 075df53..83b34f8 100644 --- a/README.md +++ b/README.md @@ -25,17 +25,18 @@ The ruleset includes checks from both the core Checkstyle library and from the S To use this ruleset add the plugin `kemitix-checktyle-ruleset-maven-plugin`. The `maven-checkstyle-plugin` will be included automatically. -Select the level 1-5 of strictness required: +The following goals implement increasingly strict rulesets: -1. layout -2. naming -3. javadoc -4. tweaks -5. complexity +* 1-layout +* 2-naming +* 3-javadoc +* 4-tweaks +* 5-complexity ```` - 2 + 2.0.0 + 5-complexity @@ -43,17 +44,12 @@ Select the level 1-5 of strictness required: net.kemitix kemitix-checkstyle-ruleset-maven-plugin - 2.0.0 - - ${kemitix-checkstyle-ruleset.level} - + ${kemitix-checkstyle-ruleset.version} validate - - check - + ${kemitix-checkstyle-ruleset.level} diff --git a/builder/src/main/resources/README-template.md b/builder/src/main/resources/README-template.md index aff6d61..489eaa5 100644 --- a/builder/src/main/resources/README-template.md +++ b/builder/src/main/resources/README-template.md @@ -25,17 +25,18 @@ The ruleset includes checks from both the core Checkstyle library and from the S To use this ruleset add the plugin `kemitix-checktyle-ruleset-maven-plugin`. The `maven-checkstyle-plugin` will be included automatically. -Select the level 1-5 of strictness required: +The following goals implement increasingly strict rulesets: -1. layout -2. naming -3. javadoc -4. tweaks -5. complexity +* 1-layout +* 2-naming +* 3-javadoc +* 4-tweaks +* 5-complexity ```` - 2 + 2.0.0 + 5-complexity @@ -43,17 +44,12 @@ Select the level 1-5 of strictness required: net.kemitix kemitix-checkstyle-ruleset-maven-plugin - 2.0.0 - - ${kemitix-checkstyle-ruleset.level} - + ${kemitix-checkstyle-ruleset.version} validate - - check - + ${kemitix-checkstyle-ruleset.level} diff --git a/plugin-sample/pom.xml b/plugin-sample/pom.xml index 927b4d2..3775fa7 100644 --- a/plugin-sample/pom.xml +++ b/plugin-sample/pom.xml @@ -22,16 +22,11 @@ net.kemitix kemitix-checkstyle-ruleset-maven-plugin 2.0.0-SNAPSHOT - - 2 - validate - - check - + 2-naming diff --git a/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/CheckMojo.java b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/AbstractCheckMojo.java similarity index 69% rename from plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/CheckMojo.java rename to plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/AbstractCheckMojo.java index eca0617..6098958 100644 --- a/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/CheckMojo.java +++ b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/AbstractCheckMojo.java @@ -26,28 +26,22 @@ package net.kemitix.checkstyle.ruleset.plugin; import lombok.Setter; import lombok.val; -import me.andrz.builder.map.MapBuilder; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.BuildPluginManager; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Component; -import org.apache.maven.plugins.annotations.LifecyclePhase; -import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.twdata.maven.mojoexecutor.MojoExecutor; -import java.util.Map; - /** * Runs the Checkstyle Maven Plugin with the Kemitix Checkstyle Ruleset. * * @author Paul Campbell (pcampbell@kemitix.net) */ -@Mojo(name = "check", defaultPhase = LifecyclePhase.VALIDATE) -public class CheckMojo extends AbstractMojo { +public abstract class AbstractCheckMojo extends AbstractMojo { private static final String CHECKSTYLE_GROUPID = "com.puppycrawl.tools"; @@ -67,28 +61,6 @@ public class CheckMojo extends AbstractMojo { private static final String CONFIG_LOCATION = "configLocation"; - - private static final String LAYOUT = "1-layout"; - - private static final String NAMING = "2-naming"; - - private static final String JAVADOC = "3-javadoc"; - - private static final String TWEAKS = "4-tweaks"; - - private static final String COMPLEXITY = "5-complexity"; - - private static Map levelConfig = new MapBuilder().put("1", LAYOUT) - .put("2", NAMING) - .put("3", JAVADOC) - .put("4", TWEAKS) - .put("5", COMPLEXITY) - .build(); - - //@Setter - //@Parameter(defaultValue = "check") - //private String goal; - @Setter @Parameter(defaultValue = "2.17") private String mavenCheckstylePluginVersion; @@ -105,10 +77,6 @@ public class CheckMojo extends AbstractMojo { @Parameter(defaultValue = "2.0.0-SNAPSHOT") private String rulesetVersion; - @Setter - @Parameter(defaultValue = "5") - private String level; - @Setter @Parameter(defaultValue = "${project}", readonly = true) private MavenProject mavenProject; @@ -120,17 +88,15 @@ public class CheckMojo extends AbstractMojo { @Component private BuildPluginManager pluginManager; - private static String getConfigFile(final String level) { - return String.format("checkstyle-%s.xml", levelConfig.getOrDefault(level, COMPLEXITY)); - } - /** * Execute Checkstyle Check. * + * @param level The level of config file to use. + * * @throws MojoExecutionException on execution error * @throws MojoFailureException on execution failure */ - public final void execute() throws MojoExecutionException, MojoFailureException { + protected final void performCheck(final String level) throws MojoExecutionException, MojoFailureException { val checkstyle = MojoExecutor.dependency(CHECKSTYLE_GROUPID, CHECKSTYLE_ARTIFACTID, checkstyleVersion); val sevntu = MojoExecutor.dependency(SEVNTU_GROUPID, SEVNTU_ARTIFACTID, sevntuVersion); val ruleset = MojoExecutor.dependency(KEMITIX_GROUPID, KEMITIX_ARTIFACTID, rulesetVersion); @@ -138,11 +104,11 @@ public class CheckMojo extends AbstractMojo { MojoExecutor.plugin(APACHE_PLUGIN_GROUPID, APACHE_PLUGIN_ARTIFACTID, mavenCheckstylePluginVersion, MojoExecutor.dependencies(checkstyle, sevntu, ruleset) ); - val configLocation = MojoExecutor.element(CONFIG_LOCATION, "net/kemitix/" + getConfigFile(level)); + val configLocation = + MojoExecutor.element(CONFIG_LOCATION, String.format("net/kemitix/checkstyle-%s.xml", level)); getLog().info( - "Running Checkstyle " + checkstyleVersion + " (sevntu: " + sevntuVersion + ") with " + getConfigFile( - level)); + String.format("Running Checkstyle %s (sevntu: %s) with %s", checkstyleVersion, sevntuVersion, level)); MojoExecutor.executeMojo(checkstylePlugin, "check", MojoExecutor.configuration(configLocation), MojoExecutor.executionEnvironment(mavenProject, mavenSession, pluginManager) ); diff --git a/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/ComplexityCheckMojo.java b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/ComplexityCheckMojo.java new file mode 100644 index 0000000..94090c8 --- /dev/null +++ b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/ComplexityCheckMojo.java @@ -0,0 +1,44 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Paul Campbell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +package net.kemitix.checkstyle.ruleset.plugin; + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; + +/** + * Runs the Checkstyle Maven Plugin with the Kemitix Checkstyle Ruleset: COMPLEXITY, TWEAKS, JAVADOC, NAMING and LAYOUT. + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ +@Mojo(name = "5-complexity", defaultPhase = LifecyclePhase.VALIDATE) +public class ComplexityCheckMojo extends AbstractCheckMojo { + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + performCheck("5-complexity"); + } +} diff --git a/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/JavadocCheckMojo.java b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/JavadocCheckMojo.java new file mode 100644 index 0000000..2952110 --- /dev/null +++ b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/JavadocCheckMojo.java @@ -0,0 +1,44 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Paul Campbell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +package net.kemitix.checkstyle.ruleset.plugin; + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; + +/** + * Runs the Checkstyle Maven Plugin with the Kemitix Checkstyle Ruleset: JAVADOC, NAMING and LAYOUT. + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ +@Mojo(name = "3-javadoc", defaultPhase = LifecyclePhase.VALIDATE) +public class JavadocCheckMojo extends AbstractCheckMojo { + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + performCheck("3-javadoc"); + } +} diff --git a/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/LayoutCheckMojo.java b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/LayoutCheckMojo.java new file mode 100644 index 0000000..e6aee8e --- /dev/null +++ b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/LayoutCheckMojo.java @@ -0,0 +1,44 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Paul Campbell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +package net.kemitix.checkstyle.ruleset.plugin; + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; + +/** + * Runs the Checkstyle Maven Plugin with the Kemitix Checkstyle Ruleset: LAYOUT. + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ +@Mojo(name = "1-layout", defaultPhase = LifecyclePhase.VALIDATE) +public class LayoutCheckMojo extends AbstractCheckMojo { + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + performCheck("1-layout"); + } +} diff --git a/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/NamingCheckMojo.java b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/NamingCheckMojo.java new file mode 100644 index 0000000..a650885 --- /dev/null +++ b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/NamingCheckMojo.java @@ -0,0 +1,44 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Paul Campbell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +package net.kemitix.checkstyle.ruleset.plugin; + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; + +/** + * Runs the Checkstyle Maven Plugin with the Kemitix Checkstyle Rulesets: NAMING and LAYOUT. + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ +@Mojo(name = "2-naming", defaultPhase = LifecyclePhase.VALIDATE) +public class NamingCheckMojo extends AbstractCheckMojo { + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + performCheck("2-naming"); + } +} diff --git a/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/TweaksCheckMojo.java b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/TweaksCheckMojo.java new file mode 100644 index 0000000..6cb2144 --- /dev/null +++ b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/TweaksCheckMojo.java @@ -0,0 +1,44 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Paul Campbell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +package net.kemitix.checkstyle.ruleset.plugin; + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; + +/** + * Runs the Checkstyle Maven Plugin with the Kemitix Checkstyle Ruleset: TWEAKS, JAVADOC, NAMING and LAYOUT. + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ +@Mojo(name = "4-tweaks", defaultPhase = LifecyclePhase.VALIDATE) +public class TweaksCheckMojo extends AbstractCheckMojo { + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + performCheck("4-tweaks"); + } +} From e8a1baa1e41f7aa719de88381f485277a518e94e Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 14 Jan 2017 17:15:45 +0000 Subject: [PATCH 10/10] plugin-sample:pom.xml: reuse project.version --- plugin-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin-sample/pom.xml b/plugin-sample/pom.xml index 3775fa7..15d13c9 100644 --- a/plugin-sample/pom.xml +++ b/plugin-sample/pom.xml @@ -21,7 +21,7 @@ net.kemitix kemitix-checkstyle-ruleset-maven-plugin - 2.0.0-SNAPSHOT + ${project.version} validate