From a6108b59c387e067b1efeb1619ed51ee72734183 Mon Sep 17 00:00:00 2001 From: Brien Colwell Date: Fri, 29 Nov 2013 15:28:33 -0800 Subject: [PATCH 1/2] target Maven 3.1 Breaking change that is not compatible with Maven < 3.1 . spoon-maven-plugin: use org.eclipse.aether instead of org.sonatype.aether . see http://maven.apache.org/docs/3.1.0/release-notes.html spoon: use android-maven-plugin 3.8.0 which is the lowest version compatible with Maven 3.1 . --- pom.xml | 6 +-- .../java/com/squareup/spoon/mojo/RunMojo.java | 40 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pom.xml b/pom.xml index 78c6de6e..847fc6d3 100644 --- a/pom.xml +++ b/pom.xml @@ -111,12 +111,12 @@ org.apache.maven maven-plugin-api - 3.0.5 + 3.1.1 org.apache.maven maven-core - 3.0.5 + 3.1.1 org.apache.maven.plugin-tools @@ -173,7 +173,7 @@ com.jayway.maven.plugins.android.generation2 android-maven-plugin - 3.6.0 + 3.8.0 16 diff --git a/spoon-maven-plugin/src/main/java/com/squareup/spoon/mojo/RunMojo.java b/spoon-maven-plugin/src/main/java/com/squareup/spoon/mojo/RunMojo.java index 67d7517f..a9c59e76 100644 --- a/spoon-maven-plugin/src/main/java/com/squareup/spoon/mojo/RunMojo.java +++ b/spoon-maven-plugin/src/main/java/com/squareup/spoon/mojo/RunMojo.java @@ -13,20 +13,20 @@ import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectHelper; -import org.sonatype.aether.RepositorySystem; -import org.sonatype.aether.RepositorySystemSession; -import org.sonatype.aether.collection.CollectRequest; -import org.sonatype.aether.collection.CollectResult; -import org.sonatype.aether.collection.DependencyCollectionException; -import org.sonatype.aether.graph.Dependency; -import org.sonatype.aether.graph.DependencyNode; -import org.sonatype.aether.graph.DependencyVisitor; -import org.sonatype.aether.repository.RemoteRepository; -import org.sonatype.aether.resolution.ArtifactRequest; -import org.sonatype.aether.resolution.ArtifactResolutionException; -import org.sonatype.aether.resolution.ArtifactResult; -import org.sonatype.aether.resolution.DependencyRequest; -import org.sonatype.aether.util.artifact.DefaultArtifact; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.collection.CollectRequest; +import org.eclipse.aether.collection.CollectResult; +import org.eclipse.aether.collection.DependencyCollectionException; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.graph.DependencyVisitor; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.resolution.ArtifactRequest; +import org.eclipse.aether.resolution.ArtifactResolutionException; +import org.eclipse.aether.resolution.ArtifactResult; +import org.eclipse.aether.resolution.DependencyRequest; +import org.eclipse.aether.artifact.DefaultArtifact; import static com.squareup.spoon.SpoonRunner.DEFAULT_OUTPUT_DIRECTORY; import static org.apache.maven.plugins.annotations.LifecyclePhase.INTEGRATION_TEST; @@ -188,7 +188,7 @@ private File getApplicationApk() throws MojoExecutionException { "Could not find application. Ensure 'apk' dependency on it exists."); } - private org.sonatype.aether.artifact.Artifact aetherArtifact(Artifact dep) + private org.eclipse.aether.artifact.Artifact aetherArtifact(Artifact dep) throws MojoExecutionException { return resolveArtifact(dep.getGroupId(), dep.getArtifactId(), "apk", dep.getVersion()); } @@ -199,7 +199,7 @@ private String getSpoonClasspath() throws MojoExecutionException { String spoonVersion = findMyVersion(); log.debug("[getSpoonClasspath] Plugin version: " + spoonVersion); - org.sonatype.aether.artifact.Artifact spoonRunner = + org.eclipse.aether.artifact.Artifact spoonRunner = resolveArtifact(SPOON_GROUP_ID, SPOON_RUNNER_ARTIFACT_ID, "jar", spoonVersion); log.debug("[getSpoonClasspath] Runner artifact: " + spoonRunner); @@ -216,7 +216,7 @@ private String findMyVersion() throws MojoExecutionException { throw new MojoExecutionException("Could not find reference to Spoon plugin artifact."); } - private org.sonatype.aether.artifact.Artifact resolveArtifact(String groupId, String artifactId, + private org.eclipse.aether.artifact.Artifact resolveArtifact(String groupId, String artifactId, String extension, String version) throws MojoExecutionException { ArtifactRequest request = new ArtifactRequest(); request.setArtifact(new DefaultArtifact(groupId, artifactId, extension, version)); @@ -230,7 +230,7 @@ private org.sonatype.aether.artifact.Artifact resolveArtifact(String groupId, St } } - private String createClasspath(org.sonatype.aether.artifact.Artifact artifact) + private String createClasspath(org.eclipse.aether.artifact.Artifact artifact) throws MojoExecutionException { // Request a collection of all dependencies for the artifact. DependencyRequest dependencyRequest = new DependencyRequest(); @@ -255,9 +255,9 @@ private String createClasspath(org.sonatype.aether.artifact.Artifact artifact) log.debug("Visiting: " + node); // Resolve the dependency node artifact into a real, local artifact. - org.sonatype.aether.artifact.Artifact resolvedArtifact; + org.eclipse.aether.artifact.Artifact resolvedArtifact; try { - org.sonatype.aether.artifact.Artifact nodeArtifact = node.getDependency().getArtifact(); + org.eclipse.aether.artifact.Artifact nodeArtifact = node.getDependency().getArtifact(); resolvedArtifact = resolveArtifact(nodeArtifact.getGroupId(), nodeArtifact.getArtifactId(), "jar", nodeArtifact.getVersion()); From 66b1a7e3a92f4cb5ef2e6e0c7a5fd4f5d7ad9dc2 Mon Sep 17 00:00:00 2001 From: Brien Colwell Date: Mon, 16 Dec 2013 11:44:03 -0800 Subject: [PATCH 2/2] pom: target android-maven-plugin 3.8.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 847fc6d3..af83dfab 100644 --- a/pom.xml +++ b/pom.xml @@ -173,7 +173,7 @@ com.jayway.maven.plugins.android.generation2 android-maven-plugin - 3.8.0 + 3.8.1 16