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
index 9f7eaba..55b178e 100644
--- a/plugin-sample/src/main/java/net/kemitix/checkstyle/sample/Sample.java
+++ b/plugin-sample/src/main/java/net/kemitix/checkstyle/sample/Sample.java
@@ -27,6 +27,9 @@ package net.kemitix.checkstyle.sample;
/**
* Sample class to test the Kemitix Checkstyle Ruleset Maven Plugin against.
*
+ * This sample is deliberately only valid for level 1-layout and 2-naming. The plugin should report errors for levels
+ * 3-javadoc and above.
+ *
* @author Paul Campbell (paul.campbell@hubio.com)
*/
public class Sample {
diff --git a/plugin/pom.xml b/plugin/pom.xml
index f1d61ea..e88bef1 100644
--- a/plugin/pom.xml
+++ b/plugin/pom.xml
@@ -7,7 +7,7 @@
net.kemitix
kemitix-checkstyle-ruleset-parent
- 2.0.4
+ 2.1.0
kemitix-checkstyle-ruleset-maven-plugin
@@ -20,7 +20,7 @@
UTF-8
UTF-8
3.3.9
- 3.6.0
+ 3.6.1
3.5
3.5
2.10.4
@@ -30,6 +30,11 @@
2.2.0
1.16.12
1.0.0
+
+ 1.0.0
+ 2.17
+ 7.5.1
+ 1.23.0
@@ -96,62 +101,99 @@
1.8
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- ${maven-javadoc-plugin.version}
+ org.codehaus.mojo
+ properties-maven-plugin
+ ${properties-maven-plugin.version}
- attach-javadocs
- verify
- jar
+ set-system-properties
+
+
+
+ maven-checkstyle-plugin.version
+ ${maven-checkstyle-plugin.version}
+
+
+ checkstyle.version
+ ${checkstyle.version}
+
+
+ sevntu.version
+ ${sevntu.version}
+
+
+
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- ${maven-source-plugin.version}
-
-
- attach-sources
- verify
-
- jar-no-fork
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- ${maven-gpg-plugin.version}
-
- ${gpg.passphrase}
-
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
- ${maven-deploy-plugin.version}
-
+
+
+
+ release
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ ${maven-javadoc-plugin.version}
+
+
+ attach-javadocs
+ verify
+
+ jar
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ ${maven-source-plugin.version}
+
+
+ attach-sources
+ verify
+
+ jar-no-fork
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ ${maven-gpg-plugin.version}
+
+ ${gpg.passphrase}
+
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ ${maven-deploy-plugin.version}
+
+
+
+
+
sevntu-maven
diff --git a/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/AbstractCheckMojo.java b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/AbstractCheckMojo.java
index de1580a..fbb72f1 100644
--- a/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/AbstractCheckMojo.java
+++ b/plugin/src/main/java/net/kemitix/checkstyle/ruleset/plugin/AbstractCheckMojo.java
@@ -62,19 +62,7 @@ public abstract class AbstractCheckMojo extends AbstractMojo {
private static final String CONFIG_LOCATION = "configLocation";
@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.4")
+ @Parameter(defaultValue = "${project.version}")
private String rulesetVersion;
@Setter
@@ -97,6 +85,12 @@ public abstract class AbstractCheckMojo extends AbstractMojo {
* @throws MojoFailureException on execution failure
*/
protected final void performCheck(final String level) throws MojoExecutionException, MojoFailureException {
+ // load versions from plugin's pom.xml
+ val properties = System.getProperties();
+ val mavenCheckstylePluginVersion = properties.getProperty("maven-checkstyle-plugin.version");
+ val checkstyleVersion = properties.getProperty("checkstyle.version");
+ val sevntuVersion = properties.getProperty("sevntu.version");
+
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);
@@ -107,8 +101,9 @@ public abstract class AbstractCheckMojo extends AbstractMojo {
val configLocation =
MojoExecutor.element(CONFIG_LOCATION, String.format("net/kemitix/checkstyle-%s.xml", level));
- getLog().info(
- String.format("Running Checkstyle %s (sevntu: %s) with %s", checkstyleVersion, sevntuVersion, level));
+ getLog().info(String.format("Running Checkstyle %s (sevntu: %s) with ruleset %s (%s)", checkstyleVersion,
+ sevntuVersion, level, rulesetVersion
+ ));
MojoExecutor.executeMojo(checkstylePlugin, "check", MojoExecutor.configuration(configLocation),
MojoExecutor.executionEnvironment(mavenProject, mavenSession, pluginManager)
);
diff --git a/pom.xml b/pom.xml
index 90a9bc6..aef2d05 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
net.kemitix
kemitix-checkstyle-ruleset-parent
- 2.0.4
+ 2.1.0
pom
Kemitix Checkstyle Ruleset (Parent)
@@ -15,7 +15,10 @@
UTF-8
UTF-8
+ 2.10.4
+ 3.0.1
1.6
+ 2.8.2
@@ -60,27 +63,69 @@
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- ${maven-gpg-plugin.version}
-
- ${gpg.passphrase}
-
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
-
+
+
+ release
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ ${maven-javadoc-plugin.version}
+
+
+ attach-javadocs
+ verify
+
+ jar
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ ${maven-source-plugin.version}
+
+
+ attach-sources
+ verify
+
+ jar-no-fork
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ ${maven-gpg-plugin.version}
+
+ ${gpg.passphrase}
+
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ ${maven-deploy-plugin.version}
+
+
+
+
+
diff --git a/ruleset/pom.xml b/ruleset/pom.xml
index 1c0ab59..869cdba 100644
--- a/ruleset/pom.xml
+++ b/ruleset/pom.xml
@@ -7,11 +7,11 @@
net.kemitix
kemitix-checkstyle-ruleset-parent
- 2.0.4
+ 2.1.0
kemitix-checkstyle-ruleset
- 2.0.4
+ 2.1.0
jar
Kemitix Checkstyle Ruleset
@@ -87,4 +87,17 @@
+
+
+
+ sonatype-nexus-snapshots
+ Sonatype Nexus Snapshots
+ https://oss.sonatype.org/content/repositories/snapshots/
+
+
+ sonatype-nexus-staging
+ Nexus Release Repository
+ https://oss.sonatype.org/service/local/staging/deploy/maven2/
+
+