From e5a3a91ac3557601e03094e90ba3ba824a01e028 Mon Sep 17 00:00:00 2001 From: Mark Derricutt Date: Tue, 27 Mar 2018 15:59:01 +1300 Subject: [PATCH] Update dependencies and README for 2.11 Change-Id: I3979e9f440a975dab3fb60226dcb6961ef026f46 --- README.adoc | 8 ++--- pom.xml | 30 ++++++++----------- .../maven/tiles/AbstractTileMojo.groovy | 2 +- .../TilesMavenLifecycleParticipant.groovy | 7 ++++- .../maven/tiles/ValidateTileMojo.groovy | 2 -- 5 files changed, 24 insertions(+), 25 deletions(-) diff --git a/README.adoc b/README.adoc index 0f53dda..0635846 100644 --- a/README.adoc +++ b/README.adoc @@ -1,4 +1,4 @@ -= Tiles Maven Plugin - Version 2.10 += Tiles Maven Plugin - Version 2.11 image:https://travis-ci.org/repaint-io/maven-tiles.svg[caption="Travis Build Status"] image:https://badges.gitter.im/repaint-io/maven-tiles.svg[link="https://gitter.im/repaint-io/maven-tiles?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"] @@ -62,7 +62,7 @@ you specify a configuration. io.repaint.maven tiles-maven-plugin - 2.10 + 2.11 true false @@ -160,7 +160,7 @@ If you need to use them, add them to your configuration section: io.repaint.maven tiles-maven-plugin - 2.10 + 2.11 dependencymanagement, dependencies, repositories, pluginrepositories @@ -233,7 +233,7 @@ be applied (in this case before `P`) resulting in the desired structure: io.repaint.maven tiles-maven-plugin - 2.10 + 2.11 group:P diff --git a/pom.xml b/pom.xml index 50eccc1..2e5e96e 100644 --- a/pom.xml +++ b/pom.xml @@ -47,12 +47,8 @@ - - 3.0.4 - - - 3.3.3 + 3.5.3 dev @@ -80,7 +76,7 @@ org.codehaus.groovy groovy-all - 2.4.8 + 2.4.14 org.apache.maven @@ -192,12 +188,12 @@ org.apache.maven.plugins maven-enforcer-plugin - 1.4.1 + 3.0.0-M1 - [3.2.2,) + [3.5.3,) @@ -234,17 +230,17 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.7.0 - 1.7 - 1.7 + 1.8 + 1.8 org.codehaus.plexus plexus-component-metadata - 1.5.5 + 1.7.1 @@ -257,7 +253,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.5 + 3.5.1 true @@ -282,21 +278,21 @@ org.apache.maven.plugins maven-surefire-plugin - 2.19.1 + 2.21.0 org.codehaus.gmavenplus gmavenplus-plugin - 1.5 + 1.6 addSources addTestSources compile - testCompile + compileTests @@ -306,7 +302,7 @@ com.bluetrainsoftware.maven groovydoc-maven-plugin - 1.3 + 2.1 attach-docs diff --git a/src/main/groovy/io/repaint/maven/tiles/AbstractTileMojo.groovy b/src/main/groovy/io/repaint/maven/tiles/AbstractTileMojo.groovy index a2ae79e..5fd9bdf 100644 --- a/src/main/groovy/io/repaint/maven/tiles/AbstractTileMojo.groovy +++ b/src/main/groovy/io/repaint/maven/tiles/AbstractTileMojo.groovy @@ -41,7 +41,7 @@ abstract class AbstractTileMojo extends AbstractMojo { @Component Logger logger - @Component + @Parameter( defaultValue = "\${session}", readonly = true ) MavenSession mavenSession @Component diff --git a/src/main/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipant.groovy b/src/main/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipant.groovy index 8c5181a..0460d31 100644 --- a/src/main/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipant.groovy +++ b/src/main/groovy/io/repaint/maven/tiles/TilesMavenLifecycleParticipant.groovy @@ -36,6 +36,7 @@ import org.apache.maven.artifact.resolver.ArtifactResolver import org.apache.maven.artifact.versioning.VersionRange import org.apache.maven.execution.MavenSession import org.apache.maven.model.Build +import org.apache.maven.model.Dependency import org.apache.maven.model.DistributionManagement import org.apache.maven.model.Model import org.apache.maven.model.Parent @@ -513,7 +514,7 @@ public class TilesMavenLifecycleParticipant extends AbstractMavenLifecyclePartic return new ModelResolver() { ModelSource2 resolveModel(String groupId, String artifactId, String version) throws UnresolvableModelException { - Artifact artifact = new DefaultArtifact(groupId, artifactId, VersionRange.createFromVersion(version), "compile", + Artifact artifact = new DefaultArtifact(groupId, artifactId, VersionRange.createFromVersion(version), "compile", "pom", null, new DefaultArtifactHandler("pom")) mavenVersionIsolate.resolveVersionRange(artifact) @@ -522,6 +523,10 @@ public class TilesMavenLifecycleParticipant extends AbstractMavenLifecyclePartic return createModelSource(artifact.file) } + ModelSource2 resolveModel(Dependency dependency) throws UnresolvableModelException { + return resolveModel(dependency.groupId, dependency.artifactId, dependency.version) + } + ModelSource2 resolveModel(Parent parent) throws UnresolvableModelException { return resolveModel(parent.groupId, parent.artifactId, parent.version) } diff --git a/src/main/groovy/io/repaint/maven/tiles/ValidateTileMojo.groovy b/src/main/groovy/io/repaint/maven/tiles/ValidateTileMojo.groovy index 33cc2ac..d0fc3c1 100644 --- a/src/main/groovy/io/repaint/maven/tiles/ValidateTileMojo.groovy +++ b/src/main/groovy/io/repaint/maven/tiles/ValidateTileMojo.groovy @@ -16,8 +16,6 @@ import org.apache.maven.plugins.annotations.ResolutionScope @CompileStatic @Mojo(name = "validate", requiresProject = true, requiresDependencyResolution = ResolutionScope.NONE) class ValidateTileMojo extends AbstractTileMojo { - @Component - MavenSession session @Override void execute() throws MojoExecutionException, MojoFailureException {