Compare commits

...

No commits in common. "c8-stream-201902" and "stream-javapackages-tools-202201-rhel-8.10.0" have entirely different histories.

6 changed files with 182 additions and 486 deletions

21
.gitignore vendored
View File

@ -1 +1,20 @@
SOURCES/maven-dependency-plugin-3.1.1-source-release.zip
/results_*
/*.src.rpm
/maven-dependency-plugin-2.2.tar.xz
/maven-dependency-plugin-2.2-source-release.zip
/maven-dependency-plugin-2.3-source-release.zip
/maven-dependency-plugin-2.4-source-release.zip
/maven-dependency-plugin-2.6-source-release.zip
/maven-dependency-plugin-2.7-source-release.zip
/maven-dependency-plugin-2.8-source-release.zip
/maven-dependency-plugin-2.9-source-release.zip
/maven-dependency-plugin-2.10-source-release.zip
/maven-dependency-plugin-3.0-SNAPSHOT-source-release.zip
/maven-dependency-plugin-3.0.0-SNAPSHOT-source-release.zip
/maven-dependency-plugin-3.0.0-source-release.zip
/maven-dependency-plugin-3.0.1-source-release.zip
/maven-dependency-plugin-3.0.2-source-release.zip
/maven-dependency-plugin-3.1.1-source-release.zip
/maven-dependency-plugin-3.1.2-source-release.zip
/maven-dependency-plugin-3.3.0-source-release.zip

View File

@ -1 +0,0 @@
b0df263c6ff7feee141ca5f6b0172795952d2a5c SOURCES/maven-dependency-plugin-3.1.1-source-release.zip

View File

@ -0,0 +1,59 @@
From eba97b2aff5bff0b67e62c1ffd87e02ccf28a7f2 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Tue, 25 Aug 2020 12:12:09 +0200
Subject: [PATCH] Port tests to maven model 3.6.X
---
.../plugins/dependency/analyze/TestAnalyzeDepMgt.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/test/java/org/apache/maven/plugins/dependency/analyze/TestAnalyzeDepMgt.java b/src/test/java/org/apache/maven/plugins/dependency/analyze/TestAnalyzeDepMgt.java
index d3392a2..5e80388 100644
--- a/src/test/java/org/apache/maven/plugins/dependency/analyze/TestAnalyzeDepMgt.java
+++ b/src/test/java/org/apache/maven/plugins/dependency/analyze/TestAnalyzeDepMgt.java
@@ -119,33 +119,42 @@ public class TestAnalyzeDepMgt
// sure it's ok before
// testing the next one
dep.setType( "t" );
+ dep.clearManagementKey();
assertNotEquals( dep.getManagementKey(), mojo.getArtifactManagementKey( artifact ) );
dep.setType( "type" );
+ dep.clearManagementKey();
assertEquals( dep.getManagementKey(), mojo.getArtifactManagementKey( artifact ) );
dep.setArtifactId( "a" );
+ dep.clearManagementKey();
assertNotEquals( dep.getManagementKey(), mojo.getArtifactManagementKey( artifact ) );
dep.setArtifactId( "artifact" );
+ dep.clearManagementKey();
assertEquals( dep.getManagementKey(), mojo.getArtifactManagementKey( artifact ) );
dep.setClassifier( "c" );
+ dep.clearManagementKey();
assertNotEquals( dep.getManagementKey(), mojo.getArtifactManagementKey( artifact ) );
dep.setClassifier( "class" );
+ dep.clearManagementKey();
assertEquals( dep.getManagementKey(), mojo.getArtifactManagementKey( artifact ) );
dep.setGroupId( "g" );
+ dep.clearManagementKey();
assertNotEquals( dep.getManagementKey(), mojo.getArtifactManagementKey( artifact ) );
dep.setGroupId( "group" );
dep.setClassifier( null );
artifact = stubFactory.createArtifact( "group", "artifact", "1.0", Artifact.SCOPE_COMPILE, "type", null );
+ dep.clearManagementKey();
assertEquals( dep.getManagementKey(), mojo.getArtifactManagementKey( artifact ) );
dep.setClassifier( "" );
artifact = stubFactory.createArtifact( "group", "artifact", "1.0", Artifact.SCOPE_COMPILE, "type", "" );
+ dep.clearManagementKey();
assertEquals( dep.getManagementKey(), mojo.getArtifactManagementKey( artifact ) );
}
--
2.35.1

View File

@ -1,461 +0,0 @@
From 8de4fc9f819388293b9e7b6113dbec57352e4761 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Wed, 11 Sep 2019 12:09:26 +0200
Subject: [PATCH] [PATCH 05/10] [MDEP-625] - Upgrade maven-artifact-transfer to
0.11.0
---
.../maven/plugins/dependency/GetMojo.java | 16 +-
.../dependency/PurgeLocalRepositoryMojo.java | 17 +-
.../AbstractFromConfigurationMojo.java | 8 +-
.../fromConfiguration/ArtifactItem.java | 2 +-
.../AbstractDependencyFilterMojo.java | 10 +-
.../fromDependencies/BuildClasspathMojo.java | 28 ++--
.../CopyDependenciesMojo.java | 8 +-
.../resolvers/AbstractResolveMojo.java | 6 +-
.../resolvers/ListRepositoriesMojo.java | 152 +++++++++---------
.../resolvers/ResolvePluginsMojo.java | 6 +-
.../utils/translators/ArtifactTranslator.java | 2 +-
.../translators/ClassifierTypeTranslator.java | 4 +-
.../TestClassifierTypeTranslator.java | 4 +-
13 files changed, 132 insertions(+), 131 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/dependency/GetMojo.java b/src/main/java/org/apache/maven/plugins/dependency/GetMojo.java
index a734f94..d434e64 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/GetMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/GetMojo.java
@@ -41,14 +41,14 @@ import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.DefaultProjectBuildingRequest;
import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.artifact.ArtifactCoordinate;
-import org.apache.maven.shared.artifact.DefaultArtifactCoordinate;
-import org.apache.maven.shared.artifact.resolve.ArtifactResolver;
-import org.apache.maven.shared.artifact.resolve.ArtifactResolverException;
-import org.apache.maven.shared.dependencies.DefaultDependableCoordinate;
-import org.apache.maven.shared.dependencies.DependableCoordinate;
-import org.apache.maven.shared.dependencies.resolve.DependencyResolver;
-import org.apache.maven.shared.dependencies.resolve.DependencyResolverException;
+import org.apache.maven.shared.transfer.artifact.ArtifactCoordinate;
+import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
+import org.apache.maven.shared.transfer.dependencies.DefaultDependableCoordinate;
+import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolver;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
import org.codehaus.plexus.util.StringUtils;
/**
diff --git a/src/main/java/org/apache/maven/plugins/dependency/PurgeLocalRepositoryMojo.java b/src/main/java/org/apache/maven/plugins/dependency/PurgeLocalRepositoryMojo.java
index da2a11d..22f16f3 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/PurgeLocalRepositoryMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/PurgeLocalRepositoryMojo.java
@@ -39,16 +39,13 @@ import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Dependency;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecution;
+import org.apache.maven.plugin.MojoExecution.Source;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.MojoExecution.Source;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
-import org.apache.maven.shared.dependencies.resolve.DependencyResolver;
-import org.apache.maven.shared.dependencies.resolve.DependencyResolverException;
-import org.apache.maven.shared.artifact.DefaultArtifactCoordinate;
import org.apache.maven.shared.artifact.filter.resolve.AbstractFilter;
import org.apache.maven.shared.artifact.filter.resolve.AndFilter;
import org.apache.maven.shared.artifact.filter.resolve.Node;
@@ -57,9 +54,13 @@ import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter;
import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter;
import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
import org.apache.maven.shared.artifact.filter.resolve.transform.ArtifactIncludeFilterTransformer;
-import org.apache.maven.shared.artifact.resolve.ArtifactResolver;
-import org.apache.maven.shared.artifact.resolve.ArtifactResolverException;
-import org.apache.maven.shared.artifact.resolve.ArtifactResult;
+import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate;
+import org.apache.maven.shared.transfer.artifact.TransferUtils;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolver;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;
@@ -666,7 +667,7 @@ public class PurgeLocalRepositoryMojo
{
//CHECKSTYLE_OFF: LineLength
artifactResolver.resolveArtifact( session.getProjectBuildingRequest(),
- org.apache.maven.shared.artifact.TransferUtils.toArtifactCoordinate( artifact ) );
+ TransferUtils.toArtifactCoordinate( artifact ) );
//CHECKSTYLE_ON: LineLength
}
catch ( ArtifactResolverException e )
diff --git a/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/AbstractFromConfigurationMojo.java b/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
index 3bebdee..377923c 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
@@ -36,11 +36,11 @@ import org.apache.maven.plugins.dependency.utils.DependencyUtil;
import org.apache.maven.plugins.dependency.utils.filters.ArtifactItemFilter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.artifact.DefaultArtifactCoordinate;
import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException;
-import org.apache.maven.shared.repository.RepositoryManager;
-import org.apache.maven.shared.artifact.resolve.ArtifactResolver;
-import org.apache.maven.shared.artifact.resolve.ArtifactResolverException;
+import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
+import org.apache.maven.shared.transfer.repository.RepositoryManager;
import org.codehaus.plexus.util.StringUtils;
/**
diff --git a/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/ArtifactItem.java b/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/ArtifactItem.java
index db215ce..2e978c3 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/ArtifactItem.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/fromConfiguration/ArtifactItem.java
@@ -24,7 +24,7 @@ import java.io.File;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.plugins.dependency.utils.DependencyUtil;
-import org.apache.maven.shared.dependencies.DependableCoordinate;
+import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
import org.codehaus.plexus.util.StringUtils;
/**
diff --git a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/AbstractDependencyFilterMojo.java b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/AbstractDependencyFilterMojo.java
index ae68cb3..03c6c54 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/AbstractDependencyFilterMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/AbstractDependencyFilterMojo.java
@@ -39,7 +39,6 @@ import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.artifact.ArtifactCoordinate;
import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException;
import org.apache.maven.shared.artifact.filter.collection.ArtifactIdFilter;
import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter;
@@ -49,10 +48,11 @@ import org.apache.maven.shared.artifact.filter.collection.GroupIdFilter;
import org.apache.maven.shared.artifact.filter.collection.ProjectTransitivityFilter;
import org.apache.maven.shared.artifact.filter.collection.ScopeFilter;
import org.apache.maven.shared.artifact.filter.collection.TypeFilter;
-import org.apache.maven.shared.repository.RepositoryManager;
-import org.apache.maven.shared.artifact.resolve.ArtifactResolver;
-import org.apache.maven.shared.artifact.resolve.ArtifactResolverException;
-import org.apache.maven.shared.dependencies.resolve.DependencyResolver;
+import org.apache.maven.shared.transfer.artifact.ArtifactCoordinate;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolver;
+import org.apache.maven.shared.transfer.repository.RepositoryManager;
import org.codehaus.plexus.util.StringUtils;
/**
diff --git a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
index d6458b3..f0a7cfd 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
@@ -19,20 +19,6 @@ package org.apache.maven.plugins.dependency.fromDependencies;
* under the License.
*/
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.dependency.utils.DependencyUtil;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.apache.maven.project.MavenProjectHelper;
-import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter;
-import org.apache.maven.shared.repository.RepositoryManager;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.StringUtils;
-
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
@@ -48,6 +34,20 @@ import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.plugins.dependency.utils.DependencyUtil;
+import org.apache.maven.project.MavenProjectHelper;
+import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter;
+import org.apache.maven.shared.transfer.repository.RepositoryManager;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.StringUtils;
+
/**
* This goal will output a classpath string of dependencies from the local repository to a file or log.
*
diff --git a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java
index 239f1c9..ec0ae60 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java
@@ -31,11 +31,11 @@ import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.artifact.DefaultArtifactCoordinate;
import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter;
-import org.apache.maven.shared.artifact.install.ArtifactInstaller;
-import org.apache.maven.shared.artifact.install.ArtifactInstallerException;
-import org.apache.maven.shared.artifact.resolve.ArtifactResolverException;
+import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate;
+import org.apache.maven.shared.transfer.artifact.install.ArtifactInstaller;
+import org.apache.maven.shared.transfer.artifact.install.ArtifactInstallerException;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
import java.io.File;
import java.util.Collections;
diff --git a/src/main/java/org/apache/maven/plugins/dependency/resolvers/AbstractResolveMojo.java b/src/main/java/org/apache/maven/plugins/dependency/resolvers/AbstractResolveMojo.java
index 8e50105..6947b59 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/resolvers/AbstractResolveMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/resolvers/AbstractResolveMojo.java
@@ -34,9 +34,9 @@ import org.apache.maven.shared.artifact.filter.collection.ClassifierFilter;
import org.apache.maven.shared.artifact.filter.collection.FilterArtifacts;
import org.apache.maven.shared.artifact.filter.collection.GroupIdFilter;
import org.apache.maven.shared.artifact.filter.collection.TypeFilter;
-import org.apache.maven.shared.artifact.resolve.ArtifactResult;
-import org.apache.maven.shared.dependencies.DependableCoordinate;
-import org.apache.maven.shared.dependencies.resolve.DependencyResolverException;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult;
+import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
/**
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
diff --git a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ListRepositoriesMojo.java b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ListRepositoriesMojo.java
index b930c3f..d1e525a 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ListRepositoriesMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ListRepositoriesMojo.java
@@ -1,76 +1,76 @@
-package org.apache.maven.plugins.dependency.resolvers;
-
-/*
- * 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.
- */
-
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.dependency.AbstractDependencyMojo;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.apache.maven.shared.dependencies.collect.CollectorResult;
-import org.apache.maven.shared.dependencies.collect.DependencyCollector;
-import org.apache.maven.shared.dependencies.collect.DependencyCollectorException;
-
-/**
- * Goal that resolves all project dependencies and then lists the repositories used by the build and by the transitive
- * dependencies
- *
- * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
- * @since 2.2
- */
-@Mojo( name = "list-repositories", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true )
-public class ListRepositoriesMojo
- extends AbstractDependencyMojo
-{
- /**
- * Dependency collector, needed to resolve dependencies.
- */
- @Component( role = DependencyCollector.class )
- private DependencyCollector dependencyCollector;
-
- /**
- * Displays a list of the repositories used by this build.
- *
- * @throws MojoExecutionException with a message if an error occurs.
- */
- @Override
- protected void doExecute()
- throws MojoExecutionException
- {
- try
- {
- CollectorResult collectResult =
- dependencyCollector.collectDependencies( session.getProjectBuildingRequest(), getProject().getModel() );
-
- this.getLog().info( "Repositories used by this build:" );
-
- for ( ArtifactRepository repo : collectResult.getRemoteRepositories() )
- {
- this.getLog().info( repo.toString() );
- }
- }
- catch ( DependencyCollectorException e )
- {
- throw new MojoExecutionException( "Unable to resolve artifacts", e );
- }
- }
-
-}
+package org.apache.maven.plugins.dependency.resolvers;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.dependency.AbstractDependencyMojo;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.shared.transfer.dependencies.collect.CollectorResult;
+import org.apache.maven.shared.transfer.dependencies.collect.DependencyCollector;
+import org.apache.maven.shared.transfer.dependencies.collect.DependencyCollectorException;
+
+/**
+ * Goal that resolves all project dependencies and then lists the repositories used by the build and by the transitive
+ * dependencies
+ *
+ * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
+ * @since 2.2
+ */
+@Mojo( name = "list-repositories", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true )
+public class ListRepositoriesMojo
+ extends AbstractDependencyMojo
+{
+ /**
+ * Dependency collector, needed to resolve dependencies.
+ */
+ @Component( role = DependencyCollector.class )
+ private DependencyCollector dependencyCollector;
+
+ /**
+ * Displays a list of the repositories used by this build.
+ *
+ * @throws MojoExecutionException with a message if an error occurs.
+ */
+ @Override
+ protected void doExecute()
+ throws MojoExecutionException
+ {
+ try
+ {
+ CollectorResult collectResult =
+ dependencyCollector.collectDependencies( session.getProjectBuildingRequest(), getProject().getModel() );
+
+ this.getLog().info( "Repositories used by this build:" );
+
+ for ( ArtifactRepository repo : collectResult.getRemoteRepositories() )
+ {
+ this.getLog().info( repo.toString() );
+ }
+ }
+ catch ( DependencyCollectorException e )
+ {
+ throw new MojoExecutionException( "Unable to resolve artifacts", e );
+ }
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolvePluginsMojo.java b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolvePluginsMojo.java
index c0aad2b..e7874ec 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolvePluginsMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolvePluginsMojo.java
@@ -36,9 +36,9 @@ import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException;
import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter;
import org.apache.maven.shared.artifact.filter.collection.FilterArtifacts;
-import org.apache.maven.shared.artifact.resolve.ArtifactResolverException;
-import org.apache.maven.shared.dependencies.DefaultDependableCoordinate;
-import org.apache.maven.shared.dependencies.resolve.DependencyResolverException;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
+import org.apache.maven.shared.transfer.dependencies.DefaultDependableCoordinate;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
/**
* Goal that resolves all project plugins and reports and their dependencies.
diff --git a/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ArtifactTranslator.java b/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ArtifactTranslator.java
index c51d9fc..ec9f6d5 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ArtifactTranslator.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ArtifactTranslator.java
@@ -23,7 +23,7 @@ import java.util.Set;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.shared.artifact.ArtifactCoordinate;
+import org.apache.maven.shared.transfer.artifact.ArtifactCoordinate;
/**
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
diff --git a/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ClassifierTypeTranslator.java b/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ClassifierTypeTranslator.java
index f31f523..41f51bc 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ClassifierTypeTranslator.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/utils/translators/ClassifierTypeTranslator.java
@@ -26,8 +26,8 @@ import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.shared.artifact.ArtifactCoordinate;
-import org.apache.maven.shared.artifact.DefaultArtifactCoordinate;
+import org.apache.maven.shared.transfer.artifact.ArtifactCoordinate;
+import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate;
import org.codehaus.plexus.util.StringUtils;
/**
diff --git a/src/test/java/org/apache/maven/plugins/dependency/utils/translators/TestClassifierTypeTranslator.java b/src/test/java/org/apache/maven/plugins/dependency/utils/translators/TestClassifierTypeTranslator.java
index cec0197..add9dd3 100644
--- a/src/test/java/org/apache/maven/plugins/dependency/utils/translators/TestClassifierTypeTranslator.java
+++ b/src/test/java/org/apache/maven/plugins/dependency/utils/translators/TestClassifierTypeTranslator.java
@@ -38,8 +38,8 @@ import org.apache.maven.plugin.testing.stubs.StubArtifactRepository;
import org.apache.maven.plugins.dependency.AbstractDependencyMojoTestCase;
import org.apache.maven.plugins.dependency.testUtils.DependencyArtifactStubFactory;
import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.artifact.ArtifactCoordinate;
-import org.apache.maven.shared.repository.RepositoryManager;
+import org.apache.maven.shared.transfer.artifact.ArtifactCoordinate;
+import org.apache.maven.shared.transfer.repository.RepositoryManager;
import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
import org.sonatype.aether.util.DefaultRepositorySystemSession;
--
2.21.0

View File

@ -1,45 +1,49 @@
%bcond_with bootstrap
Name: maven-dependency-plugin
Version: 3.1.1
Release: 2%{?dist}
Version: 3.3.0
Release: 4%{?dist}
Summary: Plugin to manipulate, copy and unpack local and remote artifacts
License: ASL 2.0
URL: http://maven.apache.org/plugins/%{name}
URL: https://maven.apache.org/plugins/%{name}
BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
Source0: http://repo2.maven.org/maven2/org/apache/maven/plugins/%{name}/%{version}/%{name}-%{version}-source-release.zip
Source0: https://repo1.maven.org/maven2/org/apache/maven/plugins/%{name}/%{version}/%{name}-%{version}-source-release.zip
Patch0: 0000-Upgrade-maven-artifact-transfer-to-0.11.0.patch
Patch0: 0001-Port-tests-to-maven-model-3.6.X.patch
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: maven-local
BuildRequires: mvn(classworlds:classworlds)
BuildRequires: mvn(commons-beanutils:commons-beanutils)
BuildRequires: mvn(commons-collections:commons-collections)
BuildRequires: mvn(commons-io:commons-io)
BuildRequires: mvn(org.apache.commons:commons-lang3)
BuildRequires: mvn(org.apache.maven.doxia:doxia-sink-api)
BuildRequires: mvn(org.apache.maven.doxia:doxia-site-renderer)
BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugins:pom:)
BuildRequires: mvn(org.apache.maven.reporting:maven-reporting-api)
BuildRequires: mvn(org.apache.maven.reporting:maven-reporting-impl)
BuildRequires: mvn(org.apache.maven.shared:file-management)
BuildRequires: mvn(org.apache.maven.shared:maven-artifact-transfer)
BuildRequires: mvn(org.apache.maven.shared:maven-common-artifact-filters)
BuildRequires: mvn(org.apache.maven.shared:maven-dependency-analyzer)
BuildRequires: mvn(org.apache.maven.shared:maven-dependency-tree)
BuildRequires: mvn(org.apache.maven.shared:maven-shared-utils)
BuildRequires: mvn(org.apache.maven:maven-aether-provider)
BuildRequires: mvn(org.apache.maven:maven-artifact)
BuildRequires: mvn(org.apache.maven:maven-core)
BuildRequires: mvn(org.apache.maven:maven-model)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: mvn(org.apache.maven:maven-repository-metadata)
BuildRequires: mvn(org.apache.maven:maven-settings)
BuildRequires: mvn(org.codehaus.plexus:plexus-archiver)
BuildRequires: mvn(org.codehaus.plexus:plexus-io)
BuildRequires: mvn(org.codehaus.plexus:plexus-utils)
BuildRequires: mvn(org.eclipse.aether:aether-api)
BuildRequires: mvn(org.eclipse.aether:aether-connector-wagon)
BuildRequires: mvn(org.eclipse.aether:aether-util)
%endif
%description
The dependency plugin provides the capability to manipulate
artifacts. It can copy and/or unpack artifacts from local or remote
repositories to a specified location.
@ -50,26 +54,37 @@ Summary: API documentation for %{name}
%description javadoc
%{summary}.
%prep
%setup -q
%patch0 -p1
%pom_remove_plugin :maven-enforcer-plugin
# We don't want to support legacy Maven versions (older than 3.1)
%pom_remove_dep org.sonatype.aether:
# Not actually needed
%pom_remove_dep :wagon-http-lightweight
# Port to apache-commons-lang3
%pom_change_dep commons-lang:commons-lang org.apache.commons:commons-lang3
find . -name '*.java' -exec sed -i 's/org\.apache\.commons\.lang/org.apache.commons.lang3/' {} +
%pom_remove_dep :maven-reporting-impl
%pom_remove_dep :commons-io
%pom_remove_dep :jetty-server
%pom_remove_dep :jetty-util
%pom_remove_dep :jetty-security
%pom_remove_dep :maven-plugin-testing-tools
%pom_change_dep :commons-collections4 commons-collections:commons-collections
sed -i '/import org.apache.commons.collections4/s/4//' src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeDuplicateMojo.java
# Tests which require eclipse
rm src/test/java/org/apache/maven/plugins/dependency/TestGetMojo.java
rm -r src/test/java/org/apache/maven/plugins/dependency/fromDependencies
rm -r src/test/java/org/apache/maven/plugins/dependency/fromConfiguration
rm src/test/java/org/apache/maven/plugins/dependency/utils/translators/TestClassifierTypeTranslator.java
# Requires org.apache.maven.reporting
rm src/main/java/org/apache/maven/plugins/dependency/analyze/AnalyzeReport{Mojo,View}.java
sed -i '/doSpecialTest( "analyze-report" );/d' src/test/java/org/apache/maven/plugins/dependency/TestSkip.java
%build
# Tests require legacy Maven
%mvn_build -f
%install
@ -82,15 +97,79 @@ find . -name '*.java' -exec sed -i 's/org\.apache\.commons\.lang/org.apache.comm
%doc LICENSE NOTICE
%changelog
* Thu Feb 08 2024 Marián Konček <mkoncek@redhat.com> - 3.3.0-4
- Rebuild to regenerate auto-requires
* Mon Feb 05 2024 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.3.0-3
- Rebuild to regenerate auto-requires
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sun Apr 24 2022 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.3.0-1
- Update to upstream version 3.3.0
* Sat Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 3.1.2-9
- Rebuilt for java-17-openjdk as system jdk
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-6
- Bootstrap build
- Non-bootstrap build
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Aug 25 2020 Marian Koncek <mkoncek@redhat.com> - 3.1.2-1
- Update to upstream version 3.1.2
* Thu Jul 30 2020 Fabio Valentini <decathorpe@gmail.com> - 3.1.2-4
- Port to commons-lang3.
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 3.1.2-2
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Thu May 07 2020 Fabio Valentini <decathorpe@gmail.com> - 3.1.2-1
- Update to version 3.1.2.
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.1-2
- Mass rebuild for javapackages-tools 201902
* Sun Nov 03 2019 Fabio Valentini <decathorpe@gmail.com> - 3.1.1-4
- Include backported patch for maven-artifact-transfer 0.11.0 support.
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Jun 04 2019 Marian Koncek <mkoncek@redhat.com> - 3.1.1-1
- Update to upstream version 3.1.1
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.0.2-3
- Mass rebuild for javapackages-tools 201901
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Nov 5 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.1-1
- Add missing BR on maven-shared-utils
* Tue Oct 30 2018 Marian Koncek <mkoncek@redhat.com> - 3.1.1-1
- Update to upstream version 3.1.1
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (maven-dependency-plugin-3.3.0-source-release.zip) = b0c650fa440078fcc63c7af70219e937be92ed16aeb6c12057e43c66e605c0d3c31f8f681b014fc0adffe1e20d5a73c5e4bbedc9c70d91637f7d85ea4d60c27c