AbstractCheckMojo: use version of plugin not the using project

${project.version} resolves to the version of the project using the plugin, rather than the version of the plugin that is being used.
This commit is contained in:
Paul Campbell 2017-02-09 11:59:37 +00:00
parent 68dc770f8d
commit a74f097844

View file

@ -71,8 +71,6 @@ abstract class AbstractCheckMojo extends AbstractMojo {
private static final String CONFIG_LOCATION = "configLocation"; private static final String CONFIG_LOCATION = "configLocation";
@Setter
@Parameter(defaultValue = "${project.version}")
private String rulesetVersion; private String rulesetVersion;
@Setter @Setter
@ -98,6 +96,9 @@ abstract class AbstractCheckMojo extends AbstractMojo {
* @throws MojoFailureException on execution failure * @throws MojoFailureException on execution failure
*/ */
final void performCheck(final String level) throws MojoExecutionException, MojoFailureException { final void performCheck(final String level) throws MojoExecutionException, MojoFailureException {
rulesetVersion = mavenProject.getPlugin(KEMITIX_GROUPID + ":" + KEMITIX_ARTIFACTID + "-maven-plugin")
.getVersion();
debug("rulesetVersion: %s", rulesetVersion);
val properties = getProperties(); val properties = getProperties();
debug("properties: %s", properties); debug("properties: %s", properties);