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

View file

@ -30,11 +30,6 @@
<mojo-executor.version>2.2.0</mojo-executor.version> <mojo-executor.version>2.2.0</mojo-executor.version>
<lombok.version>1.16.12</lombok.version> <lombok.version>1.16.12</lombok.version>
<map-builder.version>1.0.0</map-builder.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> </properties>
<dependencies> <dependencies>

View file

@ -71,6 +71,8 @@ abstract class AbstractCheckMojo extends AbstractMojo {
private static final String CONFIG_LOCATION = "configLocation"; private static final String CONFIG_LOCATION = "configLocation";
private static final String SOURCE_DIR = "sourceDirectory";
private String rulesetVersion; private String rulesetVersion;
@Setter @Setter
@ -110,7 +112,9 @@ abstract class AbstractCheckMojo extends AbstractMojo {
// configure // configure
val checkstylePlugin = getPlugin(pluginVersion, checkstyleVersion, sevntuVersion); val checkstylePlugin = getPlugin(pluginVersion, checkstyleVersion, sevntuVersion);
val configuration = MojoExecutor.configuration( 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); val environment = MojoExecutor.executionEnvironment(mavenProject, mavenSession, pluginManager);
// run // run
@ -139,7 +143,7 @@ abstract class AbstractCheckMojo extends AbstractMojo {
private Properties getProperties() throws MojoFailureException { private Properties getProperties() throws MojoFailureException {
// load properties from the plugin pom.xml // 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, val pluginArtifact = new DefaultArtifact(KEMITIX_GROUPID, pluginArtifactId, rulesetVersion, null, "", null,
new DefaultArtifactHandler("pom") new DefaultArtifactHandler("pom")
); );

View file

@ -19,6 +19,10 @@
<maven-source-plugin.version>3.0.1</maven-source-plugin.version> <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version> <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-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> </properties>
<modules> <modules>