From 2f911b4bfd3ff56aaa7045a5f987eec84a87d6fc Mon Sep 17 00:00:00 2001 From: Karl Heinz Marbaise Date: Fri, 29 Dec 2023 21:14:33 +0100 Subject: [PATCH] Fixed #445 - itf-maven-plugin:0.13.0:install fails due to missing class ArtifactIdUtils --- README.md | 28 ++++----- itf-assertj/pom.xml | 2 +- itf-documentation/pom.xml | 2 +- .../release-notes/_release-notes-0.13.1.adoc | 38 ++++++++++++ .../asciidoc/release-notes/release-notes.adoc | 2 + itf-examples/pom.xml | 8 +-- itf-extension-maven/pom.xml | 2 +- itf-failure-plugin/pom.xml | 2 +- itf-jupiter-extension/pom.xml | 2 +- itf-maven-plugin/pom.xml | 61 ++++++++----------- .../soebes/itf/maven/plugin/InstallMojo.java | 41 ++++++------- pom.xml | 4 +- 12 files changed, 107 insertions(+), 85 deletions(-) create mode 100644 itf-documentation/src/main/asciidoc/release-notes/_release-notes-0.13.1.adoc diff --git a/README.md b/README.md index 6ac94f9f6d..218b11cf6e 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,9 @@ --> | Release | Maven Central | Release Notes | Users Guide | |-----------------| --------------------------------------------------- | ----------------------------------------------------------------: | -------------------------------------------------------------: | -| 0.12.0 | [![Maven Central][shield-central]][central-search] | [![PDF][stable-pdf-releasenotes]][releasenotes-pdf] | [![PDF][stable-pdf-usersguide]][usersguide-pdf] | +| 0.13.1 | [![Maven Central][shield-central]][central-search] | [![PDF][stable-pdf-releasenotes]][releasenotes-pdf] | [![PDF][stable-pdf-usersguide]][usersguide-pdf] | | | | [![HTML][stable-html-release]][releasenotes-html] | [![HTML][stable-html-usersgude]][usersguide-html] | -| 0.13.0-SNAPSHOT | ![Maven Central][not-available-in-central] | [![PDF][unstable-pdf-releasenotes]][unstable-releasenotes-pdf] | [![PDF][unstable-pdf-usersguide]][unstable-usersguide-pdf] | +| 0.14.0-SNAPSHOT | ![Maven Central][not-available-in-central] | [![PDF][unstable-pdf-releasenotes]][unstable-releasenotes-pdf] | [![PDF][unstable-pdf-usersguide]][unstable-usersguide-pdf] | | | | [![HTML][unstable-html-releasenotes]][unstable-releasenotes-html] | [![HTML][unstable-html-usersguide]][unstable-usersguide-html] | @@ -81,13 +81,13 @@ The first thing before you can run integration tests is to add the following dep com.soebes.itf.jupiter.extension itf-jupiter-extension - 0.12.0 + 0.13.1 test com.soebes.itf.jupiter.extension itf-assertj - 0.12.0 + 0.13.1 test @@ -113,7 +113,7 @@ which handles the first part which is involved: com.soebes.itf.jupiter.extension itf-maven-plugin - 0.12.0 + 0.13.1 installing @@ -344,18 +344,18 @@ mvn clean verify org.jacoco:jacoco-maven-plugin:report [unstable-releasenotes-html]: https://khmarbaise.github.io/maven-it-extension/snapshot/itf-documentation/release-notes/release-notes.html [unstable-releasenotes-pdf]: https://khmarbaise.github.io/maven-it-extension/snapshot/itf-documentation/release-notes/release-notes.pdf -[stable-html-release]: https://img.shields.io/badge/0.12.0-HTML--Releasenotes-green -[stable-html-usersgude]: https://img.shields.io/badge/0.12.0-HTML--Usersguide-green -[stable-pdf-releasenotes]: https://img.shields.io/badge/0.12.0-PDF--Releasenotes-green -[stable-pdf-usersguide]: https://img.shields.io/badge/0.12.0-PDF--Usersguide-green +[stable-html-release]: https://img.shields.io/badge/0.13.1-HTML--Releasenotes-green +[stable-html-usersgude]: https://img.shields.io/badge/0.13.1-HTML--Usersguide-green +[stable-pdf-releasenotes]: https://img.shields.io/badge/0.13.1-PDF--Releasenotes-green +[stable-pdf-usersguide]: https://img.shields.io/badge/0.13.1-PDF--Usersguide-green -[unstable-pdf-releasenotes]: https://img.shields.io/badge/0.13.0--SNAPSHOT-PDF--Releasenotes-orange -[unstable-html-releasenotes]: https://img.shields.io/badge/0.13.0--SNAPSHOT-HTML--Releasenotes-orange -[unstable-pdf-usersguide]: https://img.shields.io/badge/0.13.0--SNAPSHOT-PDF--Usersguide-orange -[unstable-html-usersguide]: https://img.shields.io/badge/0.13.0--SNAPSHOT-HTML--Usersguide-orange +[unstable-pdf-releasenotes]: https://img.shields.io/badge/0.14.0--SNAPSHOT-PDF--Releasenotes-orange +[unstable-html-releasenotes]: https://img.shields.io/badge/0.14.0--SNAPSHOT-HTML--Releasenotes-orange +[unstable-pdf-usersguide]: https://img.shields.io/badge/0.14.0--SNAPSHOT-PDF--Usersguide-orange +[unstable-html-usersguide]: https://img.shields.io/badge/0.14.0--SNAPSHOT-HTML--Usersguide-orange [shield-central]: https://img.shields.io/maven-central/v/com.soebes.itf.jupiter.extension/itf-jupiter-extension.svg?label=Maven%20Central -[central-search]: https://search.maven.org/search?q=g%3Acom.soebes.itf.jupiter.extension +[central-search]: https://central.sonatype.com/search?q=g%3Acom.soebes.itf.jupiter.extension [not-available-in-central]: https://img.shields.io/badge/Maven%20Central-NOT_AVAILABLE-red [conceptguide-html]: https://khmarbaise.github.io/maven-it-extension/itf-documentation/concept/Concept.html diff --git a/itf-assertj/pom.xml b/itf-assertj/pom.xml index 885ae4835a..a5d1be87ae 100644 --- a/itf-assertj/pom.xml +++ b/itf-assertj/pom.xml @@ -26,7 +26,7 @@ com.soebes.itf.jupiter.extension itf-extension - 0.13.0 + 0.13.1-SNAPSHOT itf-assertj diff --git a/itf-documentation/pom.xml b/itf-documentation/pom.xml index f83a7a154b..cf5feb1ed2 100644 --- a/itf-documentation/pom.xml +++ b/itf-documentation/pom.xml @@ -26,7 +26,7 @@ com.soebes.itf.jupiter.extension itf-extension - 0.13.0 + 0.13.1-SNAPSHOT pom diff --git a/itf-documentation/src/main/asciidoc/release-notes/_release-notes-0.13.1.adoc b/itf-documentation/src/main/asciidoc/release-notes/_release-notes-0.13.1.adoc new file mode 100644 index 0000000000..a4efcd65f0 --- /dev/null +++ b/itf-documentation/src/main/asciidoc/release-notes/_release-notes-0.13.1.adoc @@ -0,0 +1,38 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// +[[release-notes-0.13.1]] +== Pre-release 0.13.1 + +:issue-445: https://github.com/khmarbaise/maven-it-extension/issues/445[Fixed #445] + +:release_0_13_1: https://github.com/khmarbaise/maven-it-extension/milestone/16 + +*Date of Release:* December 29, 2023 + +*Breaking Changes* + * A change in 0.13.0 broke the compatibility with Maven before version 3.9.0. + + * {issue-445} - itf-maven-plugin:0.13.0:install fails due to missing class ArtifactIdUtils + ** Restored compatibility with Maven before 3.9.0 + +*Reporter of this release* + + * https://github.com/acanda[Philip Graf] + ** {issue-445} - itf-maven-plugin:0.13.0:install fails due to missing class ArtifactIdUtils + +The full release notes can be found here {release_0_13_1}[Release 0.13.1]. diff --git a/itf-documentation/src/main/asciidoc/release-notes/release-notes.adoc b/itf-documentation/src/main/asciidoc/release-notes/release-notes.adoc index 613c5ff841..95b81d4bf5 100644 --- a/itf-documentation/src/main/asciidoc/release-notes/release-notes.adoc +++ b/itf-documentation/src/main/asciidoc/release-notes/release-notes.adoc @@ -30,6 +30,8 @@ Please refer to the <<../user-guide/index.adoc#user-guide,User Guide>> for a com overview and detailed instructions how to use the Integration Testing Framework. +include::{sourcedir}/_release-notes-0.13.1.adoc[] + include::{sourcedir}/_release-notes-0.13.0.adoc[] include::{sourcedir}/_release-notes-0.12.0.adoc[] diff --git a/itf-examples/pom.xml b/itf-examples/pom.xml index 66d3e7180a..10e1b51143 100644 --- a/itf-examples/pom.xml +++ b/itf-examples/pom.xml @@ -26,7 +26,7 @@ com.soebes.itf.jupiter.extension itf-extension - 0.13.0 + 0.13.1-SNAPSHOT itf-examples @@ -41,7 +41,7 @@ com.soebes.itf.jupiter.extension itf-assertj - 0.13.0 + 0.13.1-SNAPSHOT test @@ -52,7 +52,7 @@ com.soebes.itf.jupiter.extension itf-jupiter-extension - 0.13.0 + 0.13.1-SNAPSHOT test @@ -110,7 +110,7 @@ com.soebes.itf.jupiter.extension itf-maven-plugin - 0.13.0 + 0.13.1-SNAPSHOT installing diff --git a/itf-extension-maven/pom.xml b/itf-extension-maven/pom.xml index 06e3c231ad..72701f8173 100644 --- a/itf-extension-maven/pom.xml +++ b/itf-extension-maven/pom.xml @@ -26,7 +26,7 @@ com.soebes.itf.jupiter.extension itf-extension - 0.13.0 + 0.13.1-SNAPSHOT itf-extension-maven diff --git a/itf-failure-plugin/pom.xml b/itf-failure-plugin/pom.xml index 2f678b08c9..4bb23a4e68 100644 --- a/itf-failure-plugin/pom.xml +++ b/itf-failure-plugin/pom.xml @@ -26,7 +26,7 @@ com.soebes.itf.jupiter.extension itf-extension - 0.13.0 + 0.13.1-SNAPSHOT maven-plugin diff --git a/itf-jupiter-extension/pom.xml b/itf-jupiter-extension/pom.xml index 2f9d147b83..28996cb5f0 100644 --- a/itf-jupiter-extension/pom.xml +++ b/itf-jupiter-extension/pom.xml @@ -26,7 +26,7 @@ com.soebes.itf.jupiter.extension itf-extension - 0.13.0 + 0.13.1-SNAPSHOT itf-jupiter-extension diff --git a/itf-maven-plugin/pom.xml b/itf-maven-plugin/pom.xml index 59850ca024..798f714a86 100644 --- a/itf-maven-plugin/pom.xml +++ b/itf-maven-plugin/pom.xml @@ -26,7 +26,7 @@ com.soebes.itf.jupiter.extension itf-extension - 0.13.0 + 0.13.1-SNAPSHOT maven-plugin @@ -34,6 +34,8 @@ 3.2.5 + + 1.0.0.v20140518 @@ -42,26 +44,31 @@ + - com.soebes.itf.jupiter.extension - itf-extension-maven - ${project.version} + org.eclipse.aether + aether-api + ${aetherVersion} + provided - org.apache.maven - maven-core - ${mavenMinimumVersion} - provided + org.eclipse.aether + aether-util + ${aetherVersion} + + compile org.apache.maven - maven-model + maven-core ${mavenMinimumVersion} provided org.apache.maven - maven-artifact + maven-model ${mavenMinimumVersion} provided @@ -71,40 +78,27 @@ ${mavenMinimumVersion} provided - - org.apache.maven - maven-aether-provider - ${mavenMinimumVersion} + org.apache.maven.plugin-tools + maven-plugin-annotations + ${maven-plugin-plugin.version} provided - org.codehaus.plexus - plexus-xml - 4.0.3 - provided + com.soebes.itf.jupiter.extension + itf-extension-maven + ${project.version} org.codehaus.plexus - plexus-interpolation - 1.27 + plexus-utils + 3.5.1 org.apache.maven.shared maven-filtering 3.3.1 - - org.apache.maven.shared - maven-shared-utils - 3.4.2 - - - org.apache.maven.plugin-tools - maven-plugin-annotations - ${maven-plugin-plugin.version} - provided - org.junit.jupiter junit-jupiter-engine @@ -157,11 +151,6 @@ - - org.codehaus.plexus - plexus-component-metadata - 2.1.1 - diff --git a/itf-maven-plugin/src/main/java/com/soebes/itf/maven/plugin/InstallMojo.java b/itf-maven-plugin/src/main/java/com/soebes/itf/maven/plugin/InstallMojo.java index e7532c3d1f..ea620534bf 100644 --- a/itf-maven-plugin/src/main/java/com/soebes/itf/maven/plugin/InstallMojo.java +++ b/itf-maven-plugin/src/main/java/com/soebes/itf/maven/plugin/InstallMojo.java @@ -20,7 +20,6 @@ */ import org.apache.maven.RepositoryUtils; -import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.execution.MavenSession; import org.apache.maven.model.DependencyManagement; import org.apache.maven.model.Model; @@ -103,19 +102,13 @@ public class InstallMojo extends AbstractMojo { @Parameter(defaultValue = "${reactorProjects}", readonly = true) private Collection reactorProjects; - /** - * - */ - @Parameter(property = "localRepository", required = true, readonly = true) - private ArtifactRepository localRepository; - @Parameter(defaultValue = "runtime") private String scope; public void execute() throws MojoExecutionException, MojoFailureException { createTestRepository(); - Map resolvedArtifacts = new LinkedHashMap<>(); + Map resolvedArtifacts = new LinkedHashMap<>(); try { @@ -142,11 +135,11 @@ private void createTestRepository() } } - private void resolveProjectArtifacts(Map resolvedArtifacts) { + private void resolveProjectArtifacts(Map resolvedArtifacts) { // pom packaging doesn't have a main artifact if (project.getArtifact() != null && project.getArtifact().getFile() != null) { - org.eclipse.aether.artifact.Artifact artifact = RepositoryUtils.toArtifact(project.getArtifact()); + Artifact artifact = RepositoryUtils.toArtifact(project.getArtifact()); resolvedArtifacts.put(ArtifactIdUtils.toId(artifact), artifact); } @@ -155,24 +148,24 @@ private void resolveProjectArtifacts(Map resolvedArtifacts.put(ArtifactIdUtils.toId(a), a)); } - private void resolveProjectPoms(MavenProject project, Map resolvedArtifacts) + private void resolveProjectPoms(MavenProject project, Map resolvedArtifacts) throws ArtifactResolutionException { if (project == null) { return; } - org.eclipse.aether.artifact.Artifact projectPom = RepositoryUtils.toArtifact(new ProjectArtifact(project)); + Artifact projectPom = RepositoryUtils.toArtifact(new ProjectArtifact(project)); if (projectPom.getFile() != null) { resolvedArtifacts.put(projectPom.toString(), projectPom); } else { - org.eclipse.aether.artifact.Artifact artifact = resolveArtifact(projectPom, project.getRemoteProjectRepositories()); + Artifact artifact = resolveArtifact(projectPom, project.getRemoteProjectRepositories()); resolvedArtifacts.put(ArtifactIdUtils.toId(artifact), artifact); } resolveProjectPoms(project.getParent(), resolvedArtifacts); } - private void resolveProjectDependencies(Map resolvedArtifacts) + private void resolveProjectDependencies(Map resolvedArtifacts) throws ArtifactResolutionException, MojoExecutionException, DependencyResolutionException { DependencyFilter classpathFilter = DependencyFilterUtils.classpathFilter(scope); @@ -203,7 +196,7 @@ private void resolveProjectDependencies(Map artifacts = dependencyResult.getArtifactResults().stream() + List artifacts = dependencyResult.getArtifactResults().stream() .map(ArtifactResult::getArtifact) .collect(Collectors.toList()); @@ -212,19 +205,19 @@ private void resolveProjectDependencies(Map artifacts, - Map resolvedArtifacts, + List artifacts, + Map resolvedArtifacts, List remoteRepositories) throws ArtifactResolutionException, MojoExecutionException { - for (org.eclipse.aether.artifact.Artifact a : artifacts) { - org.eclipse.aether.artifact.Artifact artifactResult = resolveArtifact(new SubArtifact(a, "", "pom"), remoteRepositories); + for (Artifact a : artifacts) { + Artifact artifactResult = resolveArtifact(new SubArtifact(a, "", "pom"), remoteRepositories); resolvePomWithParents(artifactResult, resolvedArtifacts, remoteRepositories); } } private void resolvePomWithParents( - org.eclipse.aether.artifact.Artifact artifact, Map resolvedArtifacts, List remoteRepositories) + Artifact artifact, Map resolvedArtifacts, List remoteRepositories) throws MojoExecutionException, ArtifactResolutionException { if (resolvedArtifacts.containsKey(ArtifactIdUtils.toId(artifact))) { @@ -234,16 +227,16 @@ private void resolvePomWithParents( Model model = PomUtils.loadPom(artifact.getFile()); Parent parent = model.getParent(); if (parent != null) { - org.eclipse.aether.artifact.DefaultArtifact pom = + DefaultArtifact pom = new DefaultArtifact(parent.getGroupId(), parent.getArtifactId(), "", "pom", parent.getVersion()); - org.eclipse.aether.artifact.Artifact resolvedPom = resolveArtifact(pom, remoteRepositories); + Artifact resolvedPom = resolveArtifact(pom, remoteRepositories); resolvePomWithParents(resolvedPom, resolvedArtifacts, remoteRepositories); } resolvedArtifacts.put(ArtifactIdUtils.toId(artifact), artifact); } - private org.eclipse.aether.artifact.Artifact resolveArtifact(Artifact artifact, List remoteRepositories) + private Artifact resolveArtifact(Artifact artifact, List remoteRepositories) throws ArtifactResolutionException { ArtifactRequest request = new ArtifactRequest(); @@ -317,7 +310,7 @@ private RepositorySystemSession createSystemSessionForLocalRepo() { newSession.setLocalRepositoryManager(localRepositoryManager); repositorySystemSession = newSession; - getLog().debug("localRepoPath: " + getLog().debug("itfRepositoryPath: " + localRepositoryManager.getRepository().getBasedir()); } diff --git a/pom.xml b/pom.xml index a62ec7927a..b526096b8a 100644 --- a/pom.xml +++ b/pom.xml @@ -32,14 +32,14 @@ com.soebes.itf.jupiter.extension itf-extension - 0.13.0 + 0.13.1-SNAPSHOT pom scm:git:https://github.com/khmarbaise/maven-it-extension.git scm:git:ssh://git@github.com/khmarbaise/maven-it-extension.git https://github.com/khmarbaise/maven-it-extension - itf-extension-0.13.0 + HEAD