Merge pull request #11 from kemitix/locate-pom

Locate pom for settings
This commit is contained in:
Paul Campbell 2017-02-26 18:29:31 +00:00 committed by GitHub
commit 257b0c1242
4 changed files with 14 additions and 16 deletions

View file

@ -6,8 +6,8 @@
<parent>
<groupId>net.kemitix</groupId>
<artifactId>kemitix-spring-parent</artifactId>
<version>2.2.0</version>
<artifactId>kemitix-parent</artifactId>
<version>2.4.0</version>
<relativePath/>
</parent>
@ -41,7 +41,7 @@
<lombok.version>1.16.12</lombok.version>
<assertj.version>3.6.2</assertj.version>
<mapstream.version>2.3.5</mapstream.version>
<mapbuilder.version>1.0.0</mapbuilder.version>
<map-builder.version>1.0.0</map-builder.version>
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
</properties>
@ -90,17 +90,12 @@
<dependency>
<groupId>me.andrz</groupId>
<artifactId>map-builder</artifactId>
<version>${mapbuilder.version}</version>
<version>${map-builder.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.kemitix</groupId>
<artifactId>kemitix-checkstyle-ruleset-maven-plugin</artifactId>
<version>${project.version}</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>

View file

@ -30,11 +30,6 @@
<mojo-executor.version>2.2.0</mojo-executor.version>
<lombok.version>1.16.12</lombok.version>
<map-builder.version>1.0.0</map-builder.version>
<properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
<checkstyle.version>7.5.1</checkstyle.version>
<sevntu.version>1.23.0</sevntu.version>
</properties>
<dependencies>

View file

@ -71,6 +71,8 @@ abstract class AbstractCheckMojo extends AbstractMojo {
private static final String CONFIG_LOCATION = "configLocation";
private static final String SOURCE_DIR = "sourceDirectory";
private String rulesetVersion;
@Setter
@ -110,7 +112,9 @@ abstract class AbstractCheckMojo extends AbstractMojo {
// configure
val checkstylePlugin = getPlugin(pluginVersion, checkstyleVersion, sevntuVersion);
val configuration = MojoExecutor.configuration(
MojoExecutor.element(CONFIG_LOCATION, String.format("net/kemitix/checkstyle-%s.xml", level)));
MojoExecutor.element(CONFIG_LOCATION, String.format("net/kemitix/checkstyle-%s.xml", level)),
MojoExecutor.element(SOURCE_DIR, mavenProject.getBuild().getSourceDirectory())
);
val environment = MojoExecutor.executionEnvironment(mavenProject, mavenSession, pluginManager);
// run
@ -139,7 +143,7 @@ abstract class AbstractCheckMojo extends AbstractMojo {
private Properties getProperties() throws MojoFailureException {
// load properties from the plugin pom.xml
val pluginArtifactId = KEMITIX_ARTIFACTID + "-maven-plugin";
val pluginArtifactId = KEMITIX_ARTIFACTID + "-parent";
val pluginArtifact = new DefaultArtifact(KEMITIX_GROUPID, pluginArtifactId, rulesetVersion, null, "", null,
new DefaultArtifactHandler("pom")
);

View file

@ -19,6 +19,10 @@
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
<checkstyle.version>7.5.1</checkstyle.version>
<sevntu.version>1.23.0</sevntu.version>
</properties>
<modules>