You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by cs...@apache.org on 2021/04/29 13:24:21 UTC
[maven-artifact-transfer] 01/02: Step 1
This is an automated email from the ASF dual-hosted git repository.
cstamas pushed a commit to branch MSHARED-987-providers
in repository https://gitbox.apache.org/repos/asf/maven-artifact-transfer.git
commit 25248b2b28b05111341b4f6c4438ac7d9880f1f8
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Thu Apr 29 09:44:14 2021 +0200
Step 1
---
maven-3.0.x/pom.xml | 145 ++++++
.../transfer/artifact/ArtifactCoordinate.java | 118 ++---
.../artifact/DefaultArtifactCoordinate.java | 368 +++++++-------
.../shared/transfer/artifact/TransferUtils.java | 250 +++++-----
.../transfer/artifact/deploy/ArtifactDeployer.java | 0
.../artifact/deploy/ArtifactDeployerException.java | 0
.../deploy/internal/DefaultArtifactDeployer.java | 0
.../transfer/artifact/deploy/internal/Invoker.java | 0
.../deploy/internal/Maven30ArtifactDeployer.java | 0
.../deploy/internal/Maven31ArtifactDeployer.java | 0
.../deploy/internal/MavenArtifactDeployer.java | 0
.../artifact/install/ArtifactInstaller.java | 0
.../install/ArtifactInstallerException.java | 0
.../install/internal/DefaultArtifactInstaller.java | 0
.../artifact/install/internal/Invoker.java | 0
.../install/internal/Maven30ArtifactInstaller.java | 0
.../install/internal/Maven31ArtifactInstaller.java | 0
.../install/internal/MavenArtifactInstaller.java | 0
.../artifact/resolve/ArtifactResolver.java | 0
.../resolve/ArtifactResolverException.java | 0
.../transfer/artifact/resolve/ArtifactResult.java | 72 +--
.../resolve/internal/DefaultArtifactResolver.java | 0
.../artifact/resolve/internal/Invoker.java | 0
.../resolve/internal/Maven30ArtifactResolver.java | 0
.../resolve/internal/Maven30ArtifactResult.java | 114 ++---
.../resolve/internal/Maven31ArtifactResolver.java | 0
.../resolve/internal/Maven31ArtifactResult.java | 118 ++---
.../resolve/internal/MavenArtifactResolver.java | 0
.../shared/transfer/collection/CollectRequest.java | 0
.../shared/transfer/collection/CollectResult.java | 0
.../collection/DependencyCollectionException.java | 0
.../transfer/collection/DependencyCollector.java | 0
.../internal/DefaultDependencyCollector.java | 0
.../transfer/collection/internal/Invoker.java | 0
.../internal/Maven30ArtifactRepositoryAdapter.java | 0
.../collection/internal/Maven30CollectResult.java | 0
.../internal/Maven30DependencyCollector.java | 0
.../internal/Maven30DependencyNodeAdapter.java | 0
.../internal/Maven31ArtifactRepositoryAdapter.java | 0
.../collection/internal/Maven31CollectResult.java | 0
.../internal/Maven31DependencyCollector.java | 0
.../internal/Maven31DependencyNodeAdapter.java | 0
.../internal/MavenDependencyCollector.java | 0
.../dependencies/DefaultDependableCoordinate.java | 366 +++++++-------
.../dependencies/DependableCoordinate.java | 140 +++---
.../transfer/dependencies/TransferUtils.java | 272 +++++------
.../dependencies/collect/CollectorResult.java | 74 +--
.../dependencies/collect/DependencyCollector.java | 146 +++---
.../collect/DependencyCollectorException.java | 86 ++--
.../internal/DefaultDependencyCollector.java | 396 +++++++--------
.../dependencies/collect/internal/Invoker.java | 186 +++----
.../internal/Maven30ArtifactRepositoryAdapter.java | 532 ++++++++++-----------
.../collect/internal/Maven30CollectorResult.java | 170 +++----
.../internal/Maven30DependencyCollector.java | 320 ++++++-------
.../internal/Maven30DependencyNodeAdapter.java | 0
.../internal/Maven31ArtifactRepositoryAdapter.java | 532 ++++++++++-----------
.../collect/internal/Maven31CollectorResult.java | 170 +++----
.../internal/Maven31DependencyCollector.java | 320 ++++++-------
.../internal/Maven31DependencyNodeAdapter.java | 0
.../collect/internal/MavenDependencyCollector.java | 0
.../dependencies/resolve/DependencyResolver.java | 162 +++----
.../resolve/DependencyResolverException.java | 108 ++---
.../dependencies/resolve/DependencyResult.java | 74 +--
.../internal/DefaultDependencyResolver.java | 380 +++++++--------
.../dependencies/resolve/internal/Invoker.java | 190 ++++----
.../resolve/internal/Maven30ArtifactResult.java | 114 ++---
.../internal/Maven30DependencyResolver.java | 494 +++++++++----------
.../Maven30DependencyResolverException.java | 122 ++---
.../resolve/internal/Maven31ArtifactResult.java | 118 ++---
.../internal/Maven31DependencyResolver.java | 486 +++++++++----------
.../Maven31DependencyResolverException.java | 110 ++---
.../resolve/internal/MavenDependencyResolver.java | 0
.../shared/transfer/graph/DependencyNode.java | 0
.../shared/transfer/graph/DependencyVisitor.java | 0
.../shared/transfer/metadata/ArtifactMetadata.java | 0
.../metadata/internal/Maven30MetadataBridge.java | 0
.../metadata/internal/Maven31MetadataBridge.java | 0
.../shared/transfer/project/MavenAetherUtils.java | 0
.../transfer/project/NoFileAssignedException.java | 0
.../transfer/project/deploy/ProjectDeployer.java | 0
.../project/deploy/ProjectDeployerRequest.java | 264 +++++-----
.../deploy/internal/DefaultProjectDeployer.java | 0
.../transfer/project/install/ProjectInstaller.java | 0
.../project/install/ProjectInstallerRequest.java | 102 ++--
.../install/internal/DefaultProjectInstaller.java | 0
.../transfer/repository/RepositoryManager.java | 0
.../repository/RepositoryManagerException.java | 0
.../internal/DefaultRepositoryManager.java | 0
.../transfer/repository/internal/Invoker.java | 0
.../internal/Maven302RepositoryManager.java | 0
.../internal/Maven30RepositoryManager.java | 0
.../internal/Maven31RepositoryManager.java | 0
.../internal/MavenRepositoryManager.java | 0
.../artifact/DefaultArtifactCoordinateTest.java | 100 ++--
.../internal/DefaultArtifactDeployerTest.java | 0
.../internal/DefaultArtifactInstallerTest.java | 0
.../internal/Maven30ArtifactInstallerTest.java | 0
.../internal/DefaultArtifactResolverTest.java | 0
.../internal/DefaultDependencyCollectorTest.java | 0
.../DefaultDependableCoordinateTest.java | 104 ++--
.../internal/DefaultDependencyCollectorTest.java | 0
.../internal/DefaultDependencyResolverTest.java | 0
.../internal/DefaultProjectDeployerTest.java | 0
.../internal/DefaultProjectInstallerTest.java | 0
.../internal/Maven30RepositoryManagerTest.java | 0
maven-3.1.x/pom.xml | 140 ++++++
.../transfer/artifact/ArtifactCoordinate.java | 118 ++---
.../artifact/DefaultArtifactCoordinate.java | 368 +++++++-------
.../shared/transfer/artifact/TransferUtils.java | 250 +++++-----
.../transfer/artifact/deploy/ArtifactDeployer.java | 0
.../artifact/deploy/ArtifactDeployerException.java | 0
.../deploy/internal/DefaultArtifactDeployer.java | 0
.../transfer/artifact/deploy/internal/Invoker.java | 0
.../deploy/internal/Maven30ArtifactDeployer.java | 0
.../deploy/internal/Maven31ArtifactDeployer.java | 0
.../deploy/internal/MavenArtifactDeployer.java | 0
.../artifact/install/ArtifactInstaller.java | 0
.../install/ArtifactInstallerException.java | 0
.../install/internal/DefaultArtifactInstaller.java | 0
.../artifact/install/internal/Invoker.java | 0
.../install/internal/Maven30ArtifactInstaller.java | 0
.../install/internal/Maven31ArtifactInstaller.java | 0
.../install/internal/MavenArtifactInstaller.java | 0
.../artifact/resolve/ArtifactResolver.java | 0
.../resolve/ArtifactResolverException.java | 0
.../transfer/artifact/resolve/ArtifactResult.java | 72 +--
.../resolve/internal/DefaultArtifactResolver.java | 0
.../artifact/resolve/internal/Invoker.java | 0
.../resolve/internal/Maven30ArtifactResolver.java | 0
.../resolve/internal/Maven30ArtifactResult.java | 114 ++---
.../resolve/internal/Maven31ArtifactResolver.java | 0
.../resolve/internal/Maven31ArtifactResult.java | 118 ++---
.../resolve/internal/MavenArtifactResolver.java | 0
.../shared/transfer/collection/CollectRequest.java | 0
.../shared/transfer/collection/CollectResult.java | 0
.../collection/DependencyCollectionException.java | 0
.../transfer/collection/DependencyCollector.java | 0
.../internal/DefaultDependencyCollector.java | 0
.../transfer/collection/internal/Invoker.java | 0
.../internal/Maven30ArtifactRepositoryAdapter.java | 0
.../collection/internal/Maven30CollectResult.java | 0
.../internal/Maven30DependencyCollector.java | 0
.../internal/Maven30DependencyNodeAdapter.java | 0
.../internal/Maven31ArtifactRepositoryAdapter.java | 0
.../collection/internal/Maven31CollectResult.java | 0
.../internal/Maven31DependencyCollector.java | 0
.../internal/Maven31DependencyNodeAdapter.java | 0
.../internal/MavenDependencyCollector.java | 0
.../dependencies/DefaultDependableCoordinate.java | 366 +++++++-------
.../dependencies/DependableCoordinate.java | 140 +++---
.../transfer/dependencies/TransferUtils.java | 272 +++++------
.../dependencies/collect/CollectorResult.java | 74 +--
.../dependencies/collect/DependencyCollector.java | 146 +++---
.../collect/DependencyCollectorException.java | 86 ++--
.../internal/DefaultDependencyCollector.java | 396 +++++++--------
.../dependencies/collect/internal/Invoker.java | 186 +++----
.../internal/Maven30ArtifactRepositoryAdapter.java | 532 ++++++++++-----------
.../collect/internal/Maven30CollectorResult.java | 170 +++----
.../internal/Maven30DependencyCollector.java | 320 ++++++-------
.../internal/Maven30DependencyNodeAdapter.java | 0
.../internal/Maven31ArtifactRepositoryAdapter.java | 532 ++++++++++-----------
.../collect/internal/Maven31CollectorResult.java | 170 +++----
.../internal/Maven31DependencyCollector.java | 320 ++++++-------
.../internal/Maven31DependencyNodeAdapter.java | 0
.../collect/internal/MavenDependencyCollector.java | 0
.../dependencies/resolve/DependencyResolver.java | 162 +++----
.../resolve/DependencyResolverException.java | 108 ++---
.../dependencies/resolve/DependencyResult.java | 74 +--
.../internal/DefaultDependencyResolver.java | 380 +++++++--------
.../dependencies/resolve/internal/Invoker.java | 190 ++++----
.../resolve/internal/Maven30ArtifactResult.java | 114 ++---
.../internal/Maven30DependencyResolver.java | 494 +++++++++----------
.../Maven30DependencyResolverException.java | 122 ++---
.../resolve/internal/Maven31ArtifactResult.java | 118 ++---
.../internal/Maven31DependencyResolver.java | 486 +++++++++----------
.../Maven31DependencyResolverException.java | 110 ++---
.../resolve/internal/MavenDependencyResolver.java | 0
.../shared/transfer/graph/DependencyNode.java | 0
.../shared/transfer/graph/DependencyVisitor.java | 0
.../shared/transfer/metadata/ArtifactMetadata.java | 0
.../metadata/internal/Maven30MetadataBridge.java | 0
.../metadata/internal/Maven31MetadataBridge.java | 0
.../shared/transfer/project/MavenAetherUtils.java | 0
.../transfer/project/NoFileAssignedException.java | 0
.../transfer/project/deploy/ProjectDeployer.java | 0
.../project/deploy/ProjectDeployerRequest.java | 264 +++++-----
.../deploy/internal/DefaultProjectDeployer.java | 0
.../transfer/project/install/ProjectInstaller.java | 0
.../project/install/ProjectInstallerRequest.java | 102 ++--
.../install/internal/DefaultProjectInstaller.java | 0
.../transfer/repository/RepositoryManager.java | 0
.../repository/RepositoryManagerException.java | 0
.../internal/DefaultRepositoryManager.java | 0
.../transfer/repository/internal/Invoker.java | 0
.../internal/Maven302RepositoryManager.java | 0
.../internal/Maven30RepositoryManager.java | 0
.../internal/Maven31RepositoryManager.java | 0
.../internal/MavenRepositoryManager.java | 0
.../artifact/DefaultArtifactCoordinateTest.java | 100 ++--
.../internal/DefaultArtifactDeployerTest.java | 0
.../internal/DefaultArtifactInstallerTest.java | 0
.../internal/Maven30ArtifactInstallerTest.java | 0
.../internal/DefaultArtifactResolverTest.java | 0
.../internal/DefaultDependencyCollectorTest.java | 0
.../DefaultDependableCoordinateTest.java | 104 ++--
.../internal/DefaultDependencyCollectorTest.java | 0
.../internal/DefaultDependencyResolverTest.java | 0
.../internal/DefaultProjectDeployerTest.java | 0
.../internal/DefaultProjectInstallerTest.java | 0
.../internal/Maven30RepositoryManagerTest.java | 0
maven-artifact-transfer-api/pom.xml | 50 ++
.../transfer/artifact/ArtifactCoordinate.java | 118 ++---
.../artifact/DefaultArtifactCoordinate.java | 368 +++++++-------
.../shared/transfer/artifact/TransferUtils.java | 250 +++++-----
.../transfer/artifact/deploy/ArtifactDeployer.java | 0
.../artifact/deploy/ArtifactDeployerException.java | 0
.../deploy/internal/DefaultArtifactDeployer.java | 0
.../transfer/artifact/deploy/internal/Invoker.java | 0
.../deploy/internal/Maven30ArtifactDeployer.java | 0
.../deploy/internal/Maven31ArtifactDeployer.java | 0
.../deploy/internal/MavenArtifactDeployer.java | 0
.../artifact/install/ArtifactInstaller.java | 0
.../install/ArtifactInstallerException.java | 0
.../install/internal/DefaultArtifactInstaller.java | 0
.../artifact/install/internal/Invoker.java | 0
.../install/internal/Maven30ArtifactInstaller.java | 0
.../install/internal/Maven31ArtifactInstaller.java | 0
.../install/internal/MavenArtifactInstaller.java | 0
.../artifact/resolve/ArtifactResolver.java | 0
.../resolve/ArtifactResolverException.java | 0
.../transfer/artifact/resolve/ArtifactResult.java | 72 +--
.../resolve/internal/DefaultArtifactResolver.java | 0
.../artifact/resolve/internal/Invoker.java | 0
.../resolve/internal/Maven30ArtifactResolver.java | 0
.../resolve/internal/Maven30ArtifactResult.java | 114 ++---
.../resolve/internal/Maven31ArtifactResolver.java | 0
.../resolve/internal/Maven31ArtifactResult.java | 118 ++---
.../resolve/internal/MavenArtifactResolver.java | 0
.../shared/transfer/collection/CollectRequest.java | 0
.../shared/transfer/collection/CollectResult.java | 0
.../collection/DependencyCollectionException.java | 0
.../transfer/collection/DependencyCollector.java | 0
.../internal/DefaultDependencyCollector.java | 0
.../transfer/collection/internal/Invoker.java | 0
.../internal/Maven30ArtifactRepositoryAdapter.java | 0
.../collection/internal/Maven30CollectResult.java | 0
.../internal/Maven30DependencyCollector.java | 0
.../internal/Maven30DependencyNodeAdapter.java | 0
.../internal/Maven31ArtifactRepositoryAdapter.java | 0
.../collection/internal/Maven31CollectResult.java | 0
.../internal/Maven31DependencyCollector.java | 0
.../internal/Maven31DependencyNodeAdapter.java | 0
.../internal/MavenDependencyCollector.java | 0
.../dependencies/DefaultDependableCoordinate.java | 366 +++++++-------
.../dependencies/DependableCoordinate.java | 140 +++---
.../transfer/dependencies/TransferUtils.java | 272 +++++------
.../dependencies/collect/CollectorResult.java | 74 +--
.../dependencies/collect/DependencyCollector.java | 146 +++---
.../collect/DependencyCollectorException.java | 86 ++--
.../internal/DefaultDependencyCollector.java | 396 +++++++--------
.../dependencies/collect/internal/Invoker.java | 186 +++----
.../internal/Maven30ArtifactRepositoryAdapter.java | 532 ++++++++++-----------
.../collect/internal/Maven30CollectorResult.java | 170 +++----
.../internal/Maven30DependencyCollector.java | 320 ++++++-------
.../internal/Maven30DependencyNodeAdapter.java | 0
.../internal/Maven31ArtifactRepositoryAdapter.java | 532 ++++++++++-----------
.../collect/internal/Maven31CollectorResult.java | 170 +++----
.../internal/Maven31DependencyCollector.java | 320 ++++++-------
.../internal/Maven31DependencyNodeAdapter.java | 0
.../collect/internal/MavenDependencyCollector.java | 0
.../dependencies/resolve/DependencyResolver.java | 162 +++----
.../resolve/DependencyResolverException.java | 108 ++---
.../dependencies/resolve/DependencyResult.java | 74 +--
.../internal/DefaultDependencyResolver.java | 380 +++++++--------
.../dependencies/resolve/internal/Invoker.java | 190 ++++----
.../resolve/internal/Maven30ArtifactResult.java | 114 ++---
.../internal/Maven30DependencyResolver.java | 494 +++++++++----------
.../Maven30DependencyResolverException.java | 122 ++---
.../resolve/internal/Maven31ArtifactResult.java | 118 ++---
.../internal/Maven31DependencyResolver.java | 486 +++++++++----------
.../Maven31DependencyResolverException.java | 110 ++---
.../resolve/internal/MavenDependencyResolver.java | 0
.../shared/transfer/graph/DependencyNode.java | 0
.../shared/transfer/graph/DependencyVisitor.java | 0
.../shared/transfer/metadata/ArtifactMetadata.java | 0
.../metadata/internal/Maven30MetadataBridge.java | 0
.../metadata/internal/Maven31MetadataBridge.java | 0
.../shared/transfer/project/MavenAetherUtils.java | 0
.../transfer/project/NoFileAssignedException.java | 0
.../transfer/project/deploy/ProjectDeployer.java | 0
.../project/deploy/ProjectDeployerRequest.java | 264 +++++-----
.../deploy/internal/DefaultProjectDeployer.java | 0
.../transfer/project/install/ProjectInstaller.java | 0
.../project/install/ProjectInstallerRequest.java | 102 ++--
.../install/internal/DefaultProjectInstaller.java | 0
.../transfer/repository/RepositoryManager.java | 0
.../repository/RepositoryManagerException.java | 0
.../internal/DefaultRepositoryManager.java | 0
.../transfer/repository/internal/Invoker.java | 0
.../internal/Maven302RepositoryManager.java | 0
.../internal/Maven30RepositoryManager.java | 0
.../internal/Maven31RepositoryManager.java | 0
.../internal/MavenRepositoryManager.java | 0
maven-artifact-transfer/pom.xml | 147 ++++++
.../src}/it/maven-artifact-deployer-plugin/pom.xml | 0
.../artifact/deployer/ArtifactDeployerMojo.java | 0
.../artifact/deployer/ArtifactDeployerTest.java | 0
.../src/test/projects/example/pom.xml | 0
.../it/maven-artifact-installer-plugin/pom.xml | 0
.../artifact/installer/ArtifactInstallerMojo.java | 0
.../artifact/installer/ArtifactInstallerTest.java | 0
.../src/test/projects/example/pom.xml | 0
.../it/maven-dependency-collector-plugin/pom.xml | 0
.../collector/DependencyCollectorMojo.java | 0
.../collector/DependencyCollectorTest.java | 0
.../src/test/projects/example/pom.xml | 0
.../src}/it/maven-project-deployer-plugin/pom.xml | 0
.../plugin/project/deploy/ProjectDeployerMojo.java | 0
.../plugin/project/deploy/ProjectDeployerTest.java | 0
.../src/test/projects/example/pom.xml | 0
.../src}/it/maven-project-installer-plugin/pom.xml | 0
.../project/install/ProjectInstallerMojo.java | 0
.../project/install/ProjectInstallerTest.java | 0
.../src/test/projects/example/pom.xml | 0
.../src/test/projects/pom-only-example/pom.xml | 0
.../src}/it/settings.xml | 0
.../transfer/artifact/ArtifactCoordinate.java | 118 ++---
.../artifact/DefaultArtifactCoordinate.java | 368 +++++++-------
.../shared/transfer/artifact/TransferUtils.java | 250 +++++-----
.../transfer/artifact/deploy/ArtifactDeployer.java | 0
.../artifact/deploy/ArtifactDeployerException.java | 0
.../deploy/internal/DefaultArtifactDeployer.java | 0
.../transfer/artifact/deploy/internal/Invoker.java | 0
.../deploy/internal/Maven30ArtifactDeployer.java | 0
.../deploy/internal/Maven31ArtifactDeployer.java | 0
.../deploy/internal/MavenArtifactDeployer.java | 0
.../artifact/install/ArtifactInstaller.java | 0
.../install/ArtifactInstallerException.java | 0
.../install/internal/DefaultArtifactInstaller.java | 0
.../artifact/install/internal/Invoker.java | 0
.../install/internal/Maven30ArtifactInstaller.java | 0
.../install/internal/Maven31ArtifactInstaller.java | 0
.../install/internal/MavenArtifactInstaller.java | 0
.../artifact/resolve/ArtifactResolver.java | 0
.../resolve/ArtifactResolverException.java | 0
.../transfer/artifact/resolve/ArtifactResult.java | 72 +--
.../resolve/internal/DefaultArtifactResolver.java | 0
.../artifact/resolve/internal/Invoker.java | 0
.../resolve/internal/Maven30ArtifactResolver.java | 0
.../resolve/internal/Maven30ArtifactResult.java | 114 ++---
.../resolve/internal/Maven31ArtifactResolver.java | 0
.../resolve/internal/Maven31ArtifactResult.java | 118 ++---
.../resolve/internal/MavenArtifactResolver.java | 0
.../shared/transfer/collection/CollectRequest.java | 0
.../shared/transfer/collection/CollectResult.java | 0
.../collection/DependencyCollectionException.java | 0
.../transfer/collection/DependencyCollector.java | 0
.../internal/DefaultDependencyCollector.java | 0
.../transfer/collection/internal/Invoker.java | 0
.../internal/Maven30ArtifactRepositoryAdapter.java | 0
.../collection/internal/Maven30CollectResult.java | 0
.../internal/Maven30DependencyCollector.java | 0
.../internal/Maven30DependencyNodeAdapter.java | 0
.../internal/Maven31ArtifactRepositoryAdapter.java | 0
.../collection/internal/Maven31CollectResult.java | 0
.../internal/Maven31DependencyCollector.java | 0
.../internal/Maven31DependencyNodeAdapter.java | 0
.../internal/MavenDependencyCollector.java | 0
.../dependencies/DefaultDependableCoordinate.java | 366 +++++++-------
.../dependencies/DependableCoordinate.java | 140 +++---
.../transfer/dependencies/TransferUtils.java | 272 +++++------
.../dependencies/collect/CollectorResult.java | 74 +--
.../dependencies/collect/DependencyCollector.java | 146 +++---
.../collect/DependencyCollectorException.java | 86 ++--
.../internal/DefaultDependencyCollector.java | 396 +++++++--------
.../dependencies/collect/internal/Invoker.java | 186 +++----
.../internal/Maven30ArtifactRepositoryAdapter.java | 532 ++++++++++-----------
.../collect/internal/Maven30CollectorResult.java | 170 +++----
.../internal/Maven30DependencyCollector.java | 320 ++++++-------
.../internal/Maven30DependencyNodeAdapter.java | 0
.../internal/Maven31ArtifactRepositoryAdapter.java | 532 ++++++++++-----------
.../collect/internal/Maven31CollectorResult.java | 170 +++----
.../internal/Maven31DependencyCollector.java | 320 ++++++-------
.../internal/Maven31DependencyNodeAdapter.java | 0
.../collect/internal/MavenDependencyCollector.java | 0
.../dependencies/resolve/DependencyResolver.java | 162 +++----
.../resolve/DependencyResolverException.java | 108 ++---
.../dependencies/resolve/DependencyResult.java | 74 +--
.../internal/DefaultDependencyResolver.java | 380 +++++++--------
.../dependencies/resolve/internal/Invoker.java | 190 ++++----
.../resolve/internal/Maven30ArtifactResult.java | 114 ++---
.../internal/Maven30DependencyResolver.java | 494 +++++++++----------
.../Maven30DependencyResolverException.java | 122 ++---
.../resolve/internal/Maven31ArtifactResult.java | 118 ++---
.../internal/Maven31DependencyResolver.java | 486 +++++++++----------
.../Maven31DependencyResolverException.java | 110 ++---
.../resolve/internal/MavenDependencyResolver.java | 0
.../shared/transfer/graph/DependencyNode.java | 0
.../shared/transfer/graph/DependencyVisitor.java | 0
.../shared/transfer/metadata/ArtifactMetadata.java | 0
.../metadata/internal/Maven30MetadataBridge.java | 0
.../metadata/internal/Maven31MetadataBridge.java | 0
.../shared/transfer/project/MavenAetherUtils.java | 0
.../transfer/project/NoFileAssignedException.java | 0
.../transfer/project/deploy/ProjectDeployer.java | 0
.../project/deploy/ProjectDeployerRequest.java | 264 +++++-----
.../deploy/internal/DefaultProjectDeployer.java | 0
.../transfer/project/install/ProjectInstaller.java | 0
.../project/install/ProjectInstallerRequest.java | 102 ++--
.../install/internal/DefaultProjectInstaller.java | 0
.../transfer/repository/RepositoryManager.java | 0
.../repository/RepositoryManagerException.java | 0
.../internal/DefaultRepositoryManager.java | 0
.../transfer/repository/internal/Invoker.java | 0
.../internal/Maven302RepositoryManager.java | 0
.../internal/Maven30RepositoryManager.java | 0
.../internal/Maven31RepositoryManager.java | 0
.../internal/MavenRepositoryManager.java | 0
.../artifact/DefaultArtifactCoordinateTest.java | 100 ++--
.../internal/DefaultArtifactDeployerTest.java | 0
.../internal/DefaultArtifactInstallerTest.java | 0
.../internal/Maven30ArtifactInstallerTest.java | 0
.../internal/DefaultArtifactResolverTest.java | 0
.../internal/DefaultDependencyCollectorTest.java | 0
.../DefaultDependableCoordinateTest.java | 104 ++--
.../internal/DefaultDependencyCollectorTest.java | 0
.../internal/DefaultDependencyResolverTest.java | 0
.../internal/DefaultProjectDeployerTest.java | 0
.../internal/DefaultProjectInstallerTest.java | 0
.../internal/Maven30RepositoryManagerTest.java | 0
pom.xml | 407 ++++++----------
431 files changed, 15885 insertions(+), 15512 deletions(-)
diff --git a/maven-3.0.x/pom.xml b/maven-3.0.x/pom.xml
new file mode 100644
index 0000000..ee140b8
--- /dev/null
+++ b/maven-3.0.x/pom.xml
@@ -0,0 +1,145 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-artifact-transfer-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>maven-artifact-transfer-maven-3.0.x</artifactId>
+
+ <name>Apache Maven Artifact Transfer Maven 3.0.x provider</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>3.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-annotations</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-common-artifact-filters</artifactId>
+ <version>3.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>3.3.0</version>
+ </dependency>
+
+ <!-- Maven 3.0.x -->
+ <dependency>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ <version>1.7</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-util</artifactId>
+ <version>1.7</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-impl</artifactId>
+ <version>1.7</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Maven 3.1.x and above -->
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ <version>0.9.0.M2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-util</artifactId>
+ <version>0.9.0.M2</version>
+ <!-- provided scoped dependencies aren't shaded -->
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-impl</artifactId>
+ <version>0.9.0.M2</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+
+ <!-- TEST -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.13.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>2.28.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.sisu</groupId>
+ <artifactId>sisu-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>animal-sniffer-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java
index eed2eca..7b0654b 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java
@@ -1,60 +1,60 @@
-package org.apache.maven.shared.transfer.artifact;
-
-/*
- * 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.
- */
-
-/**
- * <p>
- * Contains all required elements of a Maven Artifact to resolve and calculate its path for either a local or
- * remote Maven2 repository.
- * </p>
- *
- * @author Robert Scholte
- */
-public interface ArtifactCoordinate
-{
- /**
- * @return The groupId of the artifact.
- */
- String getGroupId();
-
- /**
- * @return The artifactId of the artifact.
- */
- String getArtifactId();
-
- /**
- * A version, never a versionRange
- *
- * @return The version.
- */
- String getVersion();
-
- /**
- * The file-extension of the artifact.
- *
- * @return The extension.
- */
- String getExtension();
-
- /**
- * @return The classifier of the artifact.
- */
- String getClassifier();
+package org.apache.maven.shared.transfer.artifact;
+
+/*
+ * 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.
+ */
+
+/**
+ * <p>
+ * Contains all required elements of a Maven Artifact to resolve and calculate its path for either a local or
+ * remote Maven2 repository.
+ * </p>
+ *
+ * @author Robert Scholte
+ */
+public interface ArtifactCoordinate
+{
+ /**
+ * @return The groupId of the artifact.
+ */
+ String getGroupId();
+
+ /**
+ * @return The artifactId of the artifact.
+ */
+ String getArtifactId();
+
+ /**
+ * A version, never a versionRange
+ *
+ * @return The version.
+ */
+ String getVersion();
+
+ /**
+ * The file-extension of the artifact.
+ *
+ * @return The extension.
+ */
+ String getExtension();
+
+ /**
+ * @return The classifier of the artifact.
+ */
+ String getClassifier();
}
\ No newline at end of file
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java
similarity index 95%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java
index 070607d..9b86ee2 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java
@@ -1,184 +1,184 @@
-package org.apache.maven.shared.transfer.artifact;
-
-/*
- * 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.
- */
-
-/**
- * Common usage of an ArtifactCoordinate for a Mojo
- *
- * <pre>
- * @Parameter
- * private DefaultArtifactCoordinate[] artifacts;
- * </pre>
- *
- * and
- *
- * <pre>
- * private DefaultArtifactCoordinate artifact = new DefaultArtifactCoordinate();
- *
- * @Parameter( property = "groupId" )
- * private String groupId;
- *
- * @Parameter( property = "artifactId" )
- * private String artifactId;
- *
- * @Parameter( property = "version" )
- * private String version;
- *
- * @Parameter( property = "classifier" )
- * private String classifier;
- *
- * @Parameter( property = "type" )
- * private String type;
- *
- * public void setGroupId( String groupId )
- * {
- * this.artifact.setGroupId( groupId );
- * }
- *
- * public void setArtifactId( String artifactId )
- * {
- * this.artifact.setArtifactId( artifactId );
- * }
- *
- * public void setVersion( String version )
- * {
- * this.artifact.setVersion( version );
- * }
- *
- * public void setClassifier( String classifier )
- * {
- * this.artifact.setClassifier( classifier );
- * }
- *
- * public void setType( String type )
- * {
- * this.artifact.setType( type );
- * }
- * </pre>
- *
- * <strong>Note: </strong> type is not the same as extension! {@link org.apache.maven.artifact.handler.ArtifactHandler}s
- * are used to map a type to an extension.
- *
- * @author Robert Scholte
- * @since 3.0
- */
-public class DefaultArtifactCoordinate
- implements ArtifactCoordinate
-{
- private String groupId;
-
- private String artifactId;
-
- private String version;
-
- private String extension;
-
- private String classifier;
-
- @Override
- public final String getGroupId()
- {
- return groupId;
- }
-
- /**
- * @param groupId The groupId to be used.
- */
- public final void setGroupId( String groupId )
- {
- this.groupId = groupId;
- }
-
- @Override
- public final String getArtifactId()
- {
- return artifactId;
- }
-
- /**
- * @param artifactId The artifactId to be used.
- */
- public final void setArtifactId( String artifactId )
- {
- this.artifactId = artifactId;
- }
-
- @Override
- public final String getVersion()
- {
- return version;
- }
-
- /**
- * @param version The version to be used.
- */
- public final void setVersion( String version )
- {
- this.version = version;
- }
-
- @Override
- public final String getExtension()
- {
- return extension != null ? extension : "jar";
- }
-
- /**
- * @param extension The extension to be used.
- */
- public final void setExtension( String extension )
- {
- this.extension = extension;
- }
-
- @Override
- public final String getClassifier()
- {
- return classifier;
- }
-
- /**
- * @param classifier The classifier to be used.
- */
- public final void setClassifier( String classifier )
- {
- this.classifier = classifier;
- }
-
- /**
- * @see org.apache.maven.artifact.DefaultArtifact#toString()
- */
- @Override
- public String toString()
- {
- StringBuilder sb = new StringBuilder().append( groupId ).append( ':' )
- .append( artifactId ).append( ':' ).append( getExtension() );
-
- if ( classifier != null )
- {
- sb.append( ':' ).append( classifier );
- }
-
- sb.append( ':' ).append( version );
-
- return sb.toString();
- }
-
-}
+package org.apache.maven.shared.transfer.artifact;
+
+/*
+ * 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.
+ */
+
+/**
+ * Common usage of an ArtifactCoordinate for a Mojo
+ *
+ * <pre>
+ * @Parameter
+ * private DefaultArtifactCoordinate[] artifacts;
+ * </pre>
+ *
+ * and
+ *
+ * <pre>
+ * private DefaultArtifactCoordinate artifact = new DefaultArtifactCoordinate();
+ *
+ * @Parameter( property = "groupId" )
+ * private String groupId;
+ *
+ * @Parameter( property = "artifactId" )
+ * private String artifactId;
+ *
+ * @Parameter( property = "version" )
+ * private String version;
+ *
+ * @Parameter( property = "classifier" )
+ * private String classifier;
+ *
+ * @Parameter( property = "type" )
+ * private String type;
+ *
+ * public void setGroupId( String groupId )
+ * {
+ * this.artifact.setGroupId( groupId );
+ * }
+ *
+ * public void setArtifactId( String artifactId )
+ * {
+ * this.artifact.setArtifactId( artifactId );
+ * }
+ *
+ * public void setVersion( String version )
+ * {
+ * this.artifact.setVersion( version );
+ * }
+ *
+ * public void setClassifier( String classifier )
+ * {
+ * this.artifact.setClassifier( classifier );
+ * }
+ *
+ * public void setType( String type )
+ * {
+ * this.artifact.setType( type );
+ * }
+ * </pre>
+ *
+ * <strong>Note: </strong> type is not the same as extension! {@link org.apache.maven.artifact.handler.ArtifactHandler}s
+ * are used to map a type to an extension.
+ *
+ * @author Robert Scholte
+ * @since 3.0
+ */
+public class DefaultArtifactCoordinate
+ implements ArtifactCoordinate
+{
+ private String groupId;
+
+ private String artifactId;
+
+ private String version;
+
+ private String extension;
+
+ private String classifier;
+
+ @Override
+ public final String getGroupId()
+ {
+ return groupId;
+ }
+
+ /**
+ * @param groupId The groupId to be used.
+ */
+ public final void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
+
+ @Override
+ public final String getArtifactId()
+ {
+ return artifactId;
+ }
+
+ /**
+ * @param artifactId The artifactId to be used.
+ */
+ public final void setArtifactId( String artifactId )
+ {
+ this.artifactId = artifactId;
+ }
+
+ @Override
+ public final String getVersion()
+ {
+ return version;
+ }
+
+ /**
+ * @param version The version to be used.
+ */
+ public final void setVersion( String version )
+ {
+ this.version = version;
+ }
+
+ @Override
+ public final String getExtension()
+ {
+ return extension != null ? extension : "jar";
+ }
+
+ /**
+ * @param extension The extension to be used.
+ */
+ public final void setExtension( String extension )
+ {
+ this.extension = extension;
+ }
+
+ @Override
+ public final String getClassifier()
+ {
+ return classifier;
+ }
+
+ /**
+ * @param classifier The classifier to be used.
+ */
+ public final void setClassifier( String classifier )
+ {
+ this.classifier = classifier;
+ }
+
+ /**
+ * @see org.apache.maven.artifact.DefaultArtifact#toString()
+ */
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder().append( groupId ).append( ':' )
+ .append( artifactId ).append( ':' ).append( getExtension() );
+
+ if ( classifier != null )
+ {
+ sb.append( ':' ).append( classifier );
+ }
+
+ sb.append( ':' ).append( version );
+
+ return sb.toString();
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java
index 83fa7e1..d4506c3 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java
@@ -1,125 +1,125 @@
-package org.apache.maven.shared.transfer.artifact;
-
-/*
- * 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.Artifact;
-import org.apache.maven.model.Extension;
-import org.apache.maven.model.Parent;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.ReportPlugin;
-
-/**
- * Utility class
- *
- * @author Robert Scholte
- */
-public final class TransferUtils
-{
- private TransferUtils()
- {
- }
-
- /**
- * @param artifact {@link Artifact}
- * @return {@link ArtifactCoordinate}
- */
- public static ArtifactCoordinate toArtifactCoordinate( Artifact artifact )
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
-
- coordinate.setGroupId( artifact.getGroupId() );
- coordinate.setArtifactId( artifact.getArtifactId() );
- coordinate.setVersion( artifact.getVersion() );
- coordinate.setExtension( artifact.getArtifactHandler().getExtension() );
- coordinate.setClassifier( artifact.getClassifier() );
-
- return coordinate;
- }
-
- /**
- * Special case: an extension is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
- *
- * @param extension {@link Extension}
- * @return {@link ArtifactCoordinate}
- */
- public static ArtifactCoordinate toArtifactCoordinate( Extension extension )
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
-
- coordinate.setGroupId( extension.getGroupId() );
- coordinate.setArtifactId( extension.getArtifactId() );
- coordinate.setVersion( extension.getVersion() );
-
- return coordinate;
- }
-
- /**
- * Special case: a parent is always of type {@code pom}, so can be transformed to an ArtifactCoordinate.
- *
- * @param parent {@link Parent}
- * @return {@link ArtifactCoordinate}
- */
- public static ArtifactCoordinate toArtifactCoordinate( Parent parent )
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
-
- coordinate.setGroupId( parent.getGroupId() );
- coordinate.setArtifactId( parent.getArtifactId() );
- coordinate.setVersion( parent.getVersion() );
- coordinate.setExtension( "pom" );
-
- return coordinate;
- }
-
- /**
- * Special case: a plugin is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
- *
- * @param plugin {@link Plugin}
- * @return {@link ArtifactCoordinate}
- */
- public static ArtifactCoordinate toArtifactCoordinate( Plugin plugin )
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
-
- coordinate.setGroupId( plugin.getGroupId() );
- coordinate.setArtifactId( plugin.getArtifactId() );
- coordinate.setVersion( plugin.getVersion() );
-
- return coordinate;
- }
-
- /**
- * Special case: a reportPlugin is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
- *
- * @param plugin {@link ReportPlugin}
- * @return {@link ArtifactCoordinate}
- */
- public static ArtifactCoordinate toArtifactCoordinate( ReportPlugin plugin )
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
-
- coordinate.setGroupId( plugin.getGroupId() );
- coordinate.setArtifactId( plugin.getArtifactId() );
- coordinate.setVersion( plugin.getVersion() );
-
- return coordinate;
- }
-
-}
+package org.apache.maven.shared.transfer.artifact;
+
+/*
+ * 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.Artifact;
+import org.apache.maven.model.Extension;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.ReportPlugin;
+
+/**
+ * Utility class
+ *
+ * @author Robert Scholte
+ */
+public final class TransferUtils
+{
+ private TransferUtils()
+ {
+ }
+
+ /**
+ * @param artifact {@link Artifact}
+ * @return {@link ArtifactCoordinate}
+ */
+ public static ArtifactCoordinate toArtifactCoordinate( Artifact artifact )
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+
+ coordinate.setGroupId( artifact.getGroupId() );
+ coordinate.setArtifactId( artifact.getArtifactId() );
+ coordinate.setVersion( artifact.getVersion() );
+ coordinate.setExtension( artifact.getArtifactHandler().getExtension() );
+ coordinate.setClassifier( artifact.getClassifier() );
+
+ return coordinate;
+ }
+
+ /**
+ * Special case: an extension is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
+ *
+ * @param extension {@link Extension}
+ * @return {@link ArtifactCoordinate}
+ */
+ public static ArtifactCoordinate toArtifactCoordinate( Extension extension )
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+
+ coordinate.setGroupId( extension.getGroupId() );
+ coordinate.setArtifactId( extension.getArtifactId() );
+ coordinate.setVersion( extension.getVersion() );
+
+ return coordinate;
+ }
+
+ /**
+ * Special case: a parent is always of type {@code pom}, so can be transformed to an ArtifactCoordinate.
+ *
+ * @param parent {@link Parent}
+ * @return {@link ArtifactCoordinate}
+ */
+ public static ArtifactCoordinate toArtifactCoordinate( Parent parent )
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+
+ coordinate.setGroupId( parent.getGroupId() );
+ coordinate.setArtifactId( parent.getArtifactId() );
+ coordinate.setVersion( parent.getVersion() );
+ coordinate.setExtension( "pom" );
+
+ return coordinate;
+ }
+
+ /**
+ * Special case: a plugin is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
+ *
+ * @param plugin {@link Plugin}
+ * @return {@link ArtifactCoordinate}
+ */
+ public static ArtifactCoordinate toArtifactCoordinate( Plugin plugin )
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+
+ coordinate.setGroupId( plugin.getGroupId() );
+ coordinate.setArtifactId( plugin.getArtifactId() );
+ coordinate.setVersion( plugin.getVersion() );
+
+ return coordinate;
+ }
+
+ /**
+ * Special case: a reportPlugin is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
+ *
+ * @param plugin {@link ReportPlugin}
+ * @return {@link ArtifactCoordinate}
+ */
+ public static ArtifactCoordinate toArtifactCoordinate( ReportPlugin plugin )
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+
+ coordinate.setGroupId( plugin.getGroupId() );
+ coordinate.setArtifactId( plugin.getArtifactId() );
+ coordinate.setVersion( plugin.getVersion() );
+
+ return coordinate;
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployer.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployer.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployerException.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployerException.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployerException.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployerException.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Invoker.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Invoker.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Invoker.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Invoker.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven30ArtifactDeployer.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven30ArtifactDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven30ArtifactDeployer.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven30ArtifactDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven31ArtifactDeployer.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven31ArtifactDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven31ArtifactDeployer.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven31ArtifactDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/MavenArtifactDeployer.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/MavenArtifactDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/MavenArtifactDeployer.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/MavenArtifactDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstaller.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstaller.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstallerException.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstallerException.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstallerException.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstallerException.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Invoker.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Invoker.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Invoker.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Invoker.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstaller.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstaller.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven31ArtifactInstaller.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven31ArtifactInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven31ArtifactInstaller.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven31ArtifactInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/MavenArtifactInstaller.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/MavenArtifactInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/MavenArtifactInstaller.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/MavenArtifactInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolverException.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolverException.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolverException.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolverException.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java
index bc89ff0..6941975 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java
@@ -1,36 +1,36 @@
-package org.apache.maven.shared.transfer.artifact.resolve;
-
-/*
- * 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.Artifact;
-
-/**
- * The Artifact Result
- *
- * @author Robert Scholte
- * @since 3.0
- */
-public interface ArtifactResult
-{
- /**
- * @return {@link Artifact}
- */
- Artifact getArtifact();
-}
+package org.apache.maven.shared.transfer.artifact.resolve;
+
+/*
+ * 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.Artifact;
+
+/**
+ * The Artifact Result
+ *
+ * @author Robert Scholte
+ * @since 3.0
+ */
+public interface ArtifactResult
+{
+ /**
+ * @return {@link Artifact}
+ */
+ Artifact getArtifact();
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Invoker.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Invoker.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Invoker.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Invoker.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java
index 3bbea28..e65c00b 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java
@@ -1,57 +1,57 @@
-package org.apache.maven.shared.transfer.artifact.resolve.internal;
-
-/*
- * 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.RepositoryUtils;
-import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
-import org.sonatype.aether.artifact.Artifact;
-import org.sonatype.aether.resolution.ArtifactResult;
-
-/**
- * {@link org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult} wrapper for {@link ArtifactResult}
- *
- * @author Robert Scholte
- * @since 3.0
- */
-class Maven30ArtifactResult implements org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult
-{
- private final ArtifactResult artifactResult;
-
- /**
- * @param artifactResult {@link ArtifactResult}
- */
- Maven30ArtifactResult( ArtifactResult artifactResult )
- {
- this.artifactResult = artifactResult;
- }
-
- @Override
- public org.apache.maven.artifact.Artifact getArtifact()
- {
- try
- {
- return Invoker.invoke( RepositoryUtils.class, "toArtifact", Artifact.class, artifactResult.getArtifact() );
- }
- catch ( ArtifactResolverException e )
- {
- throw new RuntimeException( e );
- }
- }
-}
+package org.apache.maven.shared.transfer.artifact.resolve.internal;
+
+/*
+ * 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.RepositoryUtils;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
+import org.sonatype.aether.artifact.Artifact;
+import org.sonatype.aether.resolution.ArtifactResult;
+
+/**
+ * {@link org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult} wrapper for {@link ArtifactResult}
+ *
+ * @author Robert Scholte
+ * @since 3.0
+ */
+class Maven30ArtifactResult implements org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult
+{
+ private final ArtifactResult artifactResult;
+
+ /**
+ * @param artifactResult {@link ArtifactResult}
+ */
+ Maven30ArtifactResult( ArtifactResult artifactResult )
+ {
+ this.artifactResult = artifactResult;
+ }
+
+ @Override
+ public org.apache.maven.artifact.Artifact getArtifact()
+ {
+ try
+ {
+ return Invoker.invoke( RepositoryUtils.class, "toArtifact", Artifact.class, artifactResult.getArtifact() );
+ }
+ catch ( ArtifactResolverException e )
+ {
+ throw new RuntimeException( e );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResolver.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResolver.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResolver.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResolver.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResult.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResult.java
index 7b56826..56fbc0b 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResult.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven31ArtifactResult.java
@@ -1,59 +1,59 @@
-package org.apache.maven.shared.transfer.artifact.resolve.internal;
-
-/*
- * 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.RepositoryUtils;
-import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
-import org.eclipse.aether.resolution.ArtifactResult;
-import org.eclipse.aether.artifact.Artifact;
-
-/**
- * {@link org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult} wrapper for {@link ArtifactResult}
- *
- * @author Robert Scholte
- * @since 3.0
- */
-class Maven31ArtifactResult
- implements org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult
-{
- private final ArtifactResult artifactResult;
-
- /**
- * @param artifactResult {@link ArtifactResult}
- */
- Maven31ArtifactResult( ArtifactResult artifactResult )
- {
- this.artifactResult = artifactResult;
- }
-
- @Override
- public org.apache.maven.artifact.Artifact getArtifact()
- {
- try
- {
- return Invoker.invoke( RepositoryUtils.class, "toArtifact",
- Artifact.class, artifactResult.getArtifact() );
- }
- catch ( ArtifactResolverException e )
- {
- throw new RuntimeException( e );
- }
- }
-}
+package org.apache.maven.shared.transfer.artifact.resolve.internal;
+
+/*
+ * 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.RepositoryUtils;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
+import org.eclipse.aether.resolution.ArtifactResult;
+import org.eclipse.aether.artifact.Artifact;
+
+/**
+ * {@link org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult} wrapper for {@link ArtifactResult}
+ *
+ * @author Robert Scholte
+ * @since 3.0
+ */
+class Maven31ArtifactResult
+ implements org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult
+{
+ private final ArtifactResult artifactResult;
+
+ /**
+ * @param artifactResult {@link ArtifactResult}
+ */
+ Maven31ArtifactResult( ArtifactResult artifactResult )
+ {
+ this.artifactResult = artifactResult;
+ }
+
+ @Override
+ public org.apache.maven.artifact.Artifact getArtifact()
+ {
+ try
+ {
+ return Invoker.invoke( RepositoryUtils.class, "toArtifact",
+ Artifact.class, artifactResult.getArtifact() );
+ }
+ catch ( ArtifactResolverException e )
+ {
+ throw new RuntimeException( e );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/MavenArtifactResolver.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/MavenArtifactResolver.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/MavenArtifactResolver.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/MavenArtifactResolver.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/CollectRequest.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/CollectRequest.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/CollectRequest.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/CollectRequest.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/CollectResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/CollectResult.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/CollectResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/CollectResult.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/DependencyCollectionException.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/DependencyCollectionException.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/DependencyCollectionException.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/DependencyCollectionException.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/DependencyCollector.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/DependencyCollector.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/DependencyCollector.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/DependencyCollector.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollector.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollector.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollector.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollector.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/Invoker.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Invoker.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/internal/Invoker.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Invoker.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30ArtifactRepositoryAdapter.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30ArtifactRepositoryAdapter.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30ArtifactRepositoryAdapter.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30ArtifactRepositoryAdapter.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30CollectResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30CollectResult.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30CollectResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30CollectResult.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30DependencyCollector.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30DependencyCollector.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30DependencyCollector.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30DependencyCollector.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30DependencyNodeAdapter.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30DependencyNodeAdapter.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30DependencyNodeAdapter.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven30DependencyNodeAdapter.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31ArtifactRepositoryAdapter.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31ArtifactRepositoryAdapter.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31ArtifactRepositoryAdapter.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31ArtifactRepositoryAdapter.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31CollectResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31CollectResult.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31CollectResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31CollectResult.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31DependencyCollector.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31DependencyCollector.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31DependencyCollector.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31DependencyCollector.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31DependencyNodeAdapter.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31DependencyNodeAdapter.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31DependencyNodeAdapter.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/Maven31DependencyNodeAdapter.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/MavenDependencyCollector.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/MavenDependencyCollector.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/collection/internal/MavenDependencyCollector.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/collection/internal/MavenDependencyCollector.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinate.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinate.java
similarity index 95%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinate.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinate.java
index 1619586..dcd78b5 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinate.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinate.java
@@ -1,183 +1,183 @@
-package org.apache.maven.shared.transfer.dependencies;
-
-/*
- * 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.
- */
-
-/**
- * Common usage of an DependableCoordinate for a Mojo
- *
- * <pre>
- * @Parameter
- * private DefaultDependableCoordinate[] dependencies;
- * </pre>
- *
- * and
- *
- * <pre>
- * private DefaultDependableCoordinate dependable = new DefaultDependableCoordinate();
- *
- * @Parameter( property = "groupId" )
- * private String groupId;
- *
- * @Parameter( property = "artifactId" )
- * private String artifactId;
- *
- * @Parameter( property = "version" )
- * private String version;
- *
- * @Parameter( property = "classifier" )
- * private String classifier;
- *
- * @Parameter( property = "type" )
- * private String type;
- *
- * public void setGroupId( String groupId )
- * {
- * this.dependable.setGroupId( groupId );
- * }
- *
- * public void setArtifactId( String artifactId )
- * {
- * this.dependable.setArtifactId( artifactId );
- * }
- *
- * public void setVersion( String version )
- * {
- * this.dependable.setVersion( version );
- * }
- *
- * public void setClassifier( String classifier )
- * {
- * this.dependable.setClassifier( classifier );
- * }
- *
- * public void setType( String type )
- * {
- * this.dependable.setType( type );
- * }
- * </pre>
- * <strong>Note: </strong> type is not the same as extension!
- * {@link org.apache.maven.artifact.handler.ArtifactHandler}s are used to map a type to an extension.
- *
- *
- * @author Robert Scholte
- * @since 3.0
- */
-public class DefaultDependableCoordinate implements DependableCoordinate
-{
- private String groupId;
-
- private String artifactId;
-
- private String version;
-
- private String type;
-
- private String classifier;
-
- @Override
- public final String getGroupId()
- {
- return groupId;
- }
-
- /**
- * @param groupId The groupId to be set.
- */
- public final void setGroupId( String groupId )
- {
- this.groupId = groupId;
- }
-
- @Override
- public final String getArtifactId()
- {
- return artifactId;
- }
-
- /**
- * @param artifactId The artifactId to be set.
- */
- public final void setArtifactId( String artifactId )
- {
- this.artifactId = artifactId;
- }
-
- @Override
- public final String getVersion()
- {
- return version;
- }
-
- /**
- * @param version The version to be set.
- */
- public final void setVersion( String version )
- {
- this.version = version;
- }
-
- @Override
- public final String getType()
- {
- return type != null ? type : "jar";
- }
-
- /**
- * @param type The type to be set.
- */
- public void setType( String type )
- {
- this.type = type;
- }
-
- @Override
- public final String getClassifier()
- {
- return classifier;
- }
-
- /**
- * @param classifier The classifier to be set.
- */
- public final void setClassifier( String classifier )
- {
- this.classifier = classifier;
- }
-
- /**
- * @see org.apache.maven.artifact.DefaultArtifact#toString()
- */
- @Override
- public String toString()
- {
- StringBuilder sb =
- new StringBuilder().append( groupId ).append( ':' ).append( artifactId ).append( ':' ).append( getType() );
-
- if ( classifier != null )
- {
- sb.append( ':' ).append( classifier );
- }
-
- sb.append( ':' ).append( version );
-
- return sb.toString();
- }
-
-}
+package org.apache.maven.shared.transfer.dependencies;
+
+/*
+ * 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.
+ */
+
+/**
+ * Common usage of an DependableCoordinate for a Mojo
+ *
+ * <pre>
+ * @Parameter
+ * private DefaultDependableCoordinate[] dependencies;
+ * </pre>
+ *
+ * and
+ *
+ * <pre>
+ * private DefaultDependableCoordinate dependable = new DefaultDependableCoordinate();
+ *
+ * @Parameter( property = "groupId" )
+ * private String groupId;
+ *
+ * @Parameter( property = "artifactId" )
+ * private String artifactId;
+ *
+ * @Parameter( property = "version" )
+ * private String version;
+ *
+ * @Parameter( property = "classifier" )
+ * private String classifier;
+ *
+ * @Parameter( property = "type" )
+ * private String type;
+ *
+ * public void setGroupId( String groupId )
+ * {
+ * this.dependable.setGroupId( groupId );
+ * }
+ *
+ * public void setArtifactId( String artifactId )
+ * {
+ * this.dependable.setArtifactId( artifactId );
+ * }
+ *
+ * public void setVersion( String version )
+ * {
+ * this.dependable.setVersion( version );
+ * }
+ *
+ * public void setClassifier( String classifier )
+ * {
+ * this.dependable.setClassifier( classifier );
+ * }
+ *
+ * public void setType( String type )
+ * {
+ * this.dependable.setType( type );
+ * }
+ * </pre>
+ * <strong>Note: </strong> type is not the same as extension!
+ * {@link org.apache.maven.artifact.handler.ArtifactHandler}s are used to map a type to an extension.
+ *
+ *
+ * @author Robert Scholte
+ * @since 3.0
+ */
+public class DefaultDependableCoordinate implements DependableCoordinate
+{
+ private String groupId;
+
+ private String artifactId;
+
+ private String version;
+
+ private String type;
+
+ private String classifier;
+
+ @Override
+ public final String getGroupId()
+ {
+ return groupId;
+ }
+
+ /**
+ * @param groupId The groupId to be set.
+ */
+ public final void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
+
+ @Override
+ public final String getArtifactId()
+ {
+ return artifactId;
+ }
+
+ /**
+ * @param artifactId The artifactId to be set.
+ */
+ public final void setArtifactId( String artifactId )
+ {
+ this.artifactId = artifactId;
+ }
+
+ @Override
+ public final String getVersion()
+ {
+ return version;
+ }
+
+ /**
+ * @param version The version to be set.
+ */
+ public final void setVersion( String version )
+ {
+ this.version = version;
+ }
+
+ @Override
+ public final String getType()
+ {
+ return type != null ? type : "jar";
+ }
+
+ /**
+ * @param type The type to be set.
+ */
+ public void setType( String type )
+ {
+ this.type = type;
+ }
+
+ @Override
+ public final String getClassifier()
+ {
+ return classifier;
+ }
+
+ /**
+ * @param classifier The classifier to be set.
+ */
+ public final void setClassifier( String classifier )
+ {
+ this.classifier = classifier;
+ }
+
+ /**
+ * @see org.apache.maven.artifact.DefaultArtifact#toString()
+ */
+ @Override
+ public String toString()
+ {
+ StringBuilder sb =
+ new StringBuilder().append( groupId ).append( ':' ).append( artifactId ).append( ':' ).append( getType() );
+
+ if ( classifier != null )
+ {
+ sb.append( ':' ).append( classifier );
+ }
+
+ sb.append( ':' ).append( version );
+
+ return sb.toString();
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/DependableCoordinate.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/DependableCoordinate.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/DependableCoordinate.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/DependableCoordinate.java
index 5182b3d..a2e8a3b 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/DependableCoordinate.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/DependableCoordinate.java
@@ -1,70 +1,70 @@
-package org.apache.maven.shared.transfer.dependencies;
-
-/*
- * 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.
- */
-
-/**
- * <p>
- * Represents any instance which may contain Maven Dependencies, both explicit or implicit to (transitively) resolve
- * and calculate its path for either a local or remote Maven repository.
- * </p>
- * <p>
- * The version can be a version range. Based on the groupId and artifactId it will be resolved to the actual version.
- * </p>
- * <p>
- * The type will be translated to an extension based on the artifact descriptor ({@code pom.xml} matching the groupId,
- * artifactId and version.
- * </p>
- * A MavenProject is not considered a DependableCoordinate because it should never have a versionRange, and it has
- * packaging instead of type.
- *
- * @author Robert Scholte
- */
-public interface DependableCoordinate
-{
- /**
- * @return the groupId of the coordinate
- */
- String getGroupId();
-
- /**
- *
- * @return the artifact of the coordinate
- */
- String getArtifactId();
-
- /**
- * A version or versionRange
- *
- * @return the version
- */
- String getVersion();
-
- /**
- *
- * @return the type of the coordinate
- */
- String getType();
-
- /**
- *
- * @return the classifier or {@code null}
- */
- String getClassifier();
-}
+package org.apache.maven.shared.transfer.dependencies;
+
+/*
+ * 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.
+ */
+
+/**
+ * <p>
+ * Represents any instance which may contain Maven Dependencies, both explicit or implicit to (transitively) resolve
+ * and calculate its path for either a local or remote Maven repository.
+ * </p>
+ * <p>
+ * The version can be a version range. Based on the groupId and artifactId it will be resolved to the actual version.
+ * </p>
+ * <p>
+ * The type will be translated to an extension based on the artifact descriptor ({@code pom.xml} matching the groupId,
+ * artifactId and version.
+ * </p>
+ * A MavenProject is not considered a DependableCoordinate because it should never have a versionRange, and it has
+ * packaging instead of type.
+ *
+ * @author Robert Scholte
+ */
+public interface DependableCoordinate
+{
+ /**
+ * @return the groupId of the coordinate
+ */
+ String getGroupId();
+
+ /**
+ *
+ * @return the artifact of the coordinate
+ */
+ String getArtifactId();
+
+ /**
+ * A version or versionRange
+ *
+ * @return the version
+ */
+ String getVersion();
+
+ /**
+ *
+ * @return the type of the coordinate
+ */
+ String getType();
+
+ /**
+ *
+ * @return the classifier or {@code null}
+ */
+ String getClassifier();
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/TransferUtils.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/TransferUtils.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/TransferUtils.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/TransferUtils.java
index aa87f81..078ebb4 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/TransferUtils.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/TransferUtils.java
@@ -1,136 +1,136 @@
-package org.apache.maven.shared.transfer.dependencies;
-
-/*
- * 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.model.Dependency;
-import org.apache.maven.model.Extension;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Parent;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.ReportPlugin;
-
-/**
- * Utility class to convert different things like {@link Dependency}, {@link Extension}, {@link Model}, {@link Parent},
- * {@link Plugin} and {@link ReportPlugin} into {@link DependableCoordinate}.
- *
- * @author Robert Scholte
- */
-public final class TransferUtils
-{
- private TransferUtils()
- {
- }
-
- /**
- * @param dependency {@link Dependency} to be converted to {@link DependableCoordinate}
- * @return {@link DependableCoordinate}
- */
- public static DependableCoordinate toDependableCoordinate( Dependency dependency )
- {
- DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
-
- coordinate.setGroupId( dependency.getGroupId() );
- coordinate.setArtifactId( dependency.getArtifactId() );
- coordinate.setVersion( dependency.getVersion() );
- coordinate.setType( dependency.getType() );
- coordinate.setClassifier( dependency.getClassifier() );
-
- return coordinate;
- }
-
- /**
- * @param extension {@link Extension} to be converted to {@link DependableCoordinate}
- * @return {@link DependableCoordinate}
- */
- public static DependableCoordinate toDependableCoordinate( Extension extension )
- {
- DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
-
- coordinate.setGroupId( extension.getGroupId() );
- coordinate.setArtifactId( extension.getArtifactId() );
- coordinate.setVersion( extension.getVersion() );
-
- return coordinate;
- }
-
- /**
- * @param model {@link Model} coordinates to be converted to {@link DependableCoordinate}.
- * @return {@link DependableCoordinate}
- */
- public static DependableCoordinate toDependableCoordinate( Model model )
- {
- DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
-
- coordinate.setGroupId( model.getGroupId() );
- coordinate.setArtifactId( model.getArtifactId() );
- coordinate.setVersion( model.getVersion() );
- coordinate.setType( model.getPackaging() );
-
- return coordinate;
- }
-
- /**
- * @param parent {@link Parent parent} coordinates to be converted to {@link DependableCoordinate}.
- * @return {@link DependableCoordinate}.
- */
- public static DependableCoordinate toDependableCoordinate( Parent parent )
- {
- DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
-
- coordinate.setGroupId( parent.getGroupId() );
- coordinate.setArtifactId( parent.getArtifactId() );
- coordinate.setVersion( parent.getVersion() );
- coordinate.setType( "pom" );
-
- return coordinate;
- }
-
- /**
- * @param plugin The {@link Plugin plugin} coordiantes which should be converted.
- * @return {@link DependableCoordinate}.
- */
- public static DependableCoordinate toDependableCoordinate( Plugin plugin )
- {
- DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
-
- coordinate.setGroupId( plugin.getGroupId() );
- coordinate.setArtifactId( plugin.getArtifactId() );
- coordinate.setVersion( plugin.getVersion() );
-
- return coordinate;
- }
-
- /**
- * Convert {@link ReportPlugin plugin} coordinates to {@link DependableCoordinate}.
- * @param plugin The {@link ReportPlugin plugin} to be converted to {@link DependableCoordinate}.
- * @return The converted {@link DependableCoordinate} coordinates.
- */
- public static DependableCoordinate toDependableCoordinate( ReportPlugin plugin )
- {
- DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
-
- coordinate.setGroupId( plugin.getGroupId() );
- coordinate.setArtifactId( plugin.getArtifactId() );
- coordinate.setVersion( plugin.getVersion() );
-
- return coordinate;
- }
-
-}
+package org.apache.maven.shared.transfer.dependencies;
+
+/*
+ * 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.model.Dependency;
+import org.apache.maven.model.Extension;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.ReportPlugin;
+
+/**
+ * Utility class to convert different things like {@link Dependency}, {@link Extension}, {@link Model}, {@link Parent},
+ * {@link Plugin} and {@link ReportPlugin} into {@link DependableCoordinate}.
+ *
+ * @author Robert Scholte
+ */
+public final class TransferUtils
+{
+ private TransferUtils()
+ {
+ }
+
+ /**
+ * @param dependency {@link Dependency} to be converted to {@link DependableCoordinate}
+ * @return {@link DependableCoordinate}
+ */
+ public static DependableCoordinate toDependableCoordinate( Dependency dependency )
+ {
+ DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
+
+ coordinate.setGroupId( dependency.getGroupId() );
+ coordinate.setArtifactId( dependency.getArtifactId() );
+ coordinate.setVersion( dependency.getVersion() );
+ coordinate.setType( dependency.getType() );
+ coordinate.setClassifier( dependency.getClassifier() );
+
+ return coordinate;
+ }
+
+ /**
+ * @param extension {@link Extension} to be converted to {@link DependableCoordinate}
+ * @return {@link DependableCoordinate}
+ */
+ public static DependableCoordinate toDependableCoordinate( Extension extension )
+ {
+ DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
+
+ coordinate.setGroupId( extension.getGroupId() );
+ coordinate.setArtifactId( extension.getArtifactId() );
+ coordinate.setVersion( extension.getVersion() );
+
+ return coordinate;
+ }
+
+ /**
+ * @param model {@link Model} coordinates to be converted to {@link DependableCoordinate}.
+ * @return {@link DependableCoordinate}
+ */
+ public static DependableCoordinate toDependableCoordinate( Model model )
+ {
+ DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
+
+ coordinate.setGroupId( model.getGroupId() );
+ coordinate.setArtifactId( model.getArtifactId() );
+ coordinate.setVersion( model.getVersion() );
+ coordinate.setType( model.getPackaging() );
+
+ return coordinate;
+ }
+
+ /**
+ * @param parent {@link Parent parent} coordinates to be converted to {@link DependableCoordinate}.
+ * @return {@link DependableCoordinate}.
+ */
+ public static DependableCoordinate toDependableCoordinate( Parent parent )
+ {
+ DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
+
+ coordinate.setGroupId( parent.getGroupId() );
+ coordinate.setArtifactId( parent.getArtifactId() );
+ coordinate.setVersion( parent.getVersion() );
+ coordinate.setType( "pom" );
+
+ return coordinate;
+ }
+
+ /**
+ * @param plugin The {@link Plugin plugin} coordiantes which should be converted.
+ * @return {@link DependableCoordinate}.
+ */
+ public static DependableCoordinate toDependableCoordinate( Plugin plugin )
+ {
+ DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
+
+ coordinate.setGroupId( plugin.getGroupId() );
+ coordinate.setArtifactId( plugin.getArtifactId() );
+ coordinate.setVersion( plugin.getVersion() );
+
+ return coordinate;
+ }
+
+ /**
+ * Convert {@link ReportPlugin plugin} coordinates to {@link DependableCoordinate}.
+ * @param plugin The {@link ReportPlugin plugin} to be converted to {@link DependableCoordinate}.
+ * @return The converted {@link DependableCoordinate} coordinates.
+ */
+ public static DependableCoordinate toDependableCoordinate( ReportPlugin plugin )
+ {
+ DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
+
+ coordinate.setGroupId( plugin.getGroupId() );
+ coordinate.setArtifactId( plugin.getArtifactId() );
+ coordinate.setVersion( plugin.getVersion() );
+
+ return coordinate;
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/CollectorResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/CollectorResult.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/CollectorResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/CollectorResult.java
index d5a13b5..674dad5 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/CollectorResult.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/CollectorResult.java
@@ -1,37 +1,37 @@
-package org.apache.maven.shared.transfer.dependencies.collect;
-
-/*
- * 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 java.util.List;
-
-import org.apache.maven.artifact.repository.ArtifactRepository;
-
-/**
- *
- * @author Robert Scholte
- *
- */
-public interface CollectorResult
-{
- /**
- * @return List of {@link ArtifactRepository}
- */
- List<ArtifactRepository> getRemoteRepositories();
-}
+package org.apache.maven.shared.transfer.dependencies.collect;
+
+/*
+ * 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 java.util.List;
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+
+/**
+ *
+ * @author Robert Scholte
+ *
+ */
+public interface CollectorResult
+{
+ /**
+ * @return List of {@link ArtifactRepository}
+ */
+ List<ArtifactRepository> getRemoteRepositories();
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollector.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollector.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollector.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollector.java
index 2134776..0dbc465 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollector.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollector.java
@@ -1,73 +1,73 @@
-package org.apache.maven.shared.transfer.dependencies.collect;
-
-/*
- * 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.model.Dependency;
-import org.apache.maven.model.Model;
-import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
-
-/**
- * Will only download the pom files when not available, never the artifact.
- *
- * @author Robert Scholte
- *
- */
-public interface DependencyCollector
-{
-
- /**
- * A dependency may have excludes
- *
- * @param buildingRequest {@link ProjectBuildingRequest}
- * @param root {@link Dependency}
- * @return {@link CollectorResult}
- * @throws DependencyCollectorException in case of an error.
- * @throws IllegalArgumentException in case of parameter <code>buildingRequest</code> is <code>null</code> or
- * parameter <code>root</code> is <code>null</code>.
- */
- CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, Dependency root )
- throws DependencyCollectorException;
-
- /**
- * @param buildingRequest {@link ProjectBuildingRequest}.
- * @param root {@link DependableCoordinate}
- * @return {@link CollectorResult}
- * @throws DependencyCollectorException in case of an error which can be a component lookup error or
- * an error while trying to look up the dependencies.
- * @throws IllegalArgumentException in case of parameter <code>buildingRequest</code> is <code>null</code> or
- * parameter <code>root</code> is <code>null</code>.
- */
- CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, DependableCoordinate root )
- throws DependencyCollectorException;
-
- /**
- * @param buildingRequest {@link ProjectBuildingRequest}.
- * @param root {@link Model}
- * @return {@link CollectorResult}
- * @throws DependencyCollectorException in case of an error which can be a component lookup error or
- * an error while trying to look up the dependencies.
- * @throws IllegalArgumentException in case of parameter <code>buildingRequest</code> is <code>null</code> or
- * parameter <code>root</code> is <code>null</code>.
- */
- CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, Model root )
- throws DependencyCollectorException;
-
-}
+package org.apache.maven.shared.transfer.dependencies.collect;
+
+/*
+ * 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.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
+
+/**
+ * Will only download the pom files when not available, never the artifact.
+ *
+ * @author Robert Scholte
+ *
+ */
+public interface DependencyCollector
+{
+
+ /**
+ * A dependency may have excludes
+ *
+ * @param buildingRequest {@link ProjectBuildingRequest}
+ * @param root {@link Dependency}
+ * @return {@link CollectorResult}
+ * @throws DependencyCollectorException in case of an error.
+ * @throws IllegalArgumentException in case of parameter <code>buildingRequest</code> is <code>null</code> or
+ * parameter <code>root</code> is <code>null</code>.
+ */
+ CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, Dependency root )
+ throws DependencyCollectorException;
+
+ /**
+ * @param buildingRequest {@link ProjectBuildingRequest}.
+ * @param root {@link DependableCoordinate}
+ * @return {@link CollectorResult}
+ * @throws DependencyCollectorException in case of an error which can be a component lookup error or
+ * an error while trying to look up the dependencies.
+ * @throws IllegalArgumentException in case of parameter <code>buildingRequest</code> is <code>null</code> or
+ * parameter <code>root</code> is <code>null</code>.
+ */
+ CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, DependableCoordinate root )
+ throws DependencyCollectorException;
+
+ /**
+ * @param buildingRequest {@link ProjectBuildingRequest}.
+ * @param root {@link Model}
+ * @return {@link CollectorResult}
+ * @throws DependencyCollectorException in case of an error which can be a component lookup error or
+ * an error while trying to look up the dependencies.
+ * @throws IllegalArgumentException in case of parameter <code>buildingRequest</code> is <code>null</code> or
+ * parameter <code>root</code> is <code>null</code>.
+ */
+ CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, Model root )
+ throws DependencyCollectorException;
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollectorException.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollectorException.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollectorException.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollectorException.java
index c959b05..cc5a784 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollectorException.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/DependencyCollectorException.java
@@ -1,43 +1,43 @@
-package org.apache.maven.shared.transfer.dependencies.collect;
-
-/*
- * 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.
- */
-
-/**
- *
- * @author Robert Scholte
- */
-public class DependencyCollectorException extends Exception
-{
-
- /**
- *
- */
- private static final long serialVersionUID = -180986912170441437L;
-
- /**
- * @param message The message you would give for the exception.
- * @param cause The cause which is related to the message.
- */
- public DependencyCollectorException( String message, Throwable cause )
- {
- super( message, cause );
- }
-
-}
+package org.apache.maven.shared.transfer.dependencies.collect;
+
+/*
+ * 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.
+ */
+
+/**
+ *
+ * @author Robert Scholte
+ */
+public class DependencyCollectorException extends Exception
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -180986912170441437L;
+
+ /**
+ * @param message The message you would give for the exception.
+ * @param cause The cause which is related to the message.
+ */
+ public DependencyCollectorException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollector.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollector.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollector.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollector.java
index fb1e498..bf84fc9 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollector.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollector.java
@@ -1,198 +1,198 @@
-package org.apache.maven.shared.transfer.dependencies.collect.internal;
-
-/*
- * 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 java.util.List;
-
-import org.apache.maven.RepositoryUtils;
-import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.model.Model;
-import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
-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;
-import org.codehaus.plexus.PlexusConstants;
-import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
-import org.codehaus.plexus.context.Context;
-import org.codehaus.plexus.context.ContextException;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
-
-/**
- * This DependencyCollector passes the request to the proper Maven 3.x implementation
- *
- * @author Robert Scholte
- */
-@Component( role = DependencyCollector.class, hint = "default" )
-class DefaultDependencyCollector implements DependencyCollector, Contextualizable
-{
- private PlexusContainer container;
-
- @Override
- public CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, Dependency root )
- throws DependencyCollectorException
- {
- validateParameters( buildingRequest, root );
-
- try
- {
- return getMavenDependencyCollector( buildingRequest ).collectDependencies( root );
- }
- catch ( ComponentLookupException e )
- {
- throw new DependencyCollectorException( e.getMessage(), e );
- }
- }
-
- @Override
- public CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, DependableCoordinate root )
- throws DependencyCollectorException
- {
- validateParameters( buildingRequest, root );
-
- try
- {
- return getMavenDependencyCollector( buildingRequest ).collectDependencies( root );
- }
- catch ( ComponentLookupException e )
- {
- throw new DependencyCollectorException( e.getMessage(), e );
- }
- }
-
- @Override
- public CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, Model root )
- throws DependencyCollectorException
- {
- validateParameters( buildingRequest, root );
-
- try
- {
- return getMavenDependencyCollector( buildingRequest ).collectDependencies( root );
- }
- catch ( ComponentLookupException e )
- {
- throw new DependencyCollectorException( e.getMessage(), e );
- }
- }
-
- private void validateParameters( ProjectBuildingRequest buildingRequest, DependableCoordinate root )
- {
- validateBuildingRequest( buildingRequest );
- validateRoot( root );
- }
-
- private void validateParameters( ProjectBuildingRequest buildingRequest, Dependency root )
- {
- validateBuildingRequest( buildingRequest );
- validateRoot( root );
- }
-
- private void validateParameters( ProjectBuildingRequest buildingRequest, Model root )
- {
- validateBuildingRequest( buildingRequest );
- validateRoot( root );
- }
-
- private void validateBuildingRequest( ProjectBuildingRequest buildingRequest )
- {
- if ( buildingRequest == null )
- {
- throw new IllegalArgumentException( "The parameter buildingRequest is not allowed to be null." );
- }
- }
-
- private void validateRoot( Object root )
- {
- if ( root == null )
- {
- throw new IllegalArgumentException( "The parameter root is not allowed to be null." );
- }
- }
-
- /**
- * @return true if the current Maven version is Maven 3.1.
- */
- private boolean isMaven31()
- {
- try
- {
- // Maven 3.1 specific
- Thread.currentThread().getContextClassLoader().loadClass( "org.eclipse.aether.artifact.Artifact" );
- return true;
- }
- catch ( ClassNotFoundException e )
- {
- return false;
- }
- }
-
- /**
- * Injects the Plexus content.
- *
- * @param context Plexus context to inject.
- * @throws ContextException if the PlexusContainer could not be located.
- */
- public void contextualize( Context context ) throws ContextException
- {
- container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
- }
-
- private MavenDependencyCollector getMavenDependencyCollector( ProjectBuildingRequest buildingRequest )
- throws ComponentLookupException, DependencyCollectorException
- {
- ArtifactHandlerManager artifactHandlerManager = container.lookup( ArtifactHandlerManager.class );
-
- if ( isMaven31() )
- {
- org.eclipse.aether.RepositorySystem m31RepositorySystem = container.lookup(
- org.eclipse.aether.RepositorySystem.class );
-
- org.eclipse.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
- "getRepositorySession" );
-
- List<org.eclipse.aether.repository.RemoteRepository> aetherRepositories = Invoker.invoke(
- RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() );
-
- return new Maven31DependencyCollector( m31RepositorySystem, artifactHandlerManager, session,
- aetherRepositories );
- }
- else
- {
-
- org.sonatype.aether.RepositorySystem m30RepositorySystem = container.lookup(
- org.sonatype.aether.RepositorySystem.class );
-
- org.sonatype.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
- "getRepositorySession" );
-
- List<org.sonatype.aether.repository.RemoteRepository> aetherRepositories = Invoker.invoke(
- RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() );
-
- return new Maven30DependencyCollector( m30RepositorySystem, artifactHandlerManager, session,
- aetherRepositories );
- }
-
- }
-
-}
+package org.apache.maven.shared.transfer.dependencies.collect.internal;
+
+/*
+ * 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 java.util.List;
+
+import org.apache.maven.RepositoryUtils;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
+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;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+
+/**
+ * This DependencyCollector passes the request to the proper Maven 3.x implementation
+ *
+ * @author Robert Scholte
+ */
+@Component( role = DependencyCollector.class, hint = "default" )
+class DefaultDependencyCollector implements DependencyCollector, Contextualizable
+{
+ private PlexusContainer container;
+
+ @Override
+ public CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, Dependency root )
+ throws DependencyCollectorException
+ {
+ validateParameters( buildingRequest, root );
+
+ try
+ {
+ return getMavenDependencyCollector( buildingRequest ).collectDependencies( root );
+ }
+ catch ( ComponentLookupException e )
+ {
+ throw new DependencyCollectorException( e.getMessage(), e );
+ }
+ }
+
+ @Override
+ public CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, DependableCoordinate root )
+ throws DependencyCollectorException
+ {
+ validateParameters( buildingRequest, root );
+
+ try
+ {
+ return getMavenDependencyCollector( buildingRequest ).collectDependencies( root );
+ }
+ catch ( ComponentLookupException e )
+ {
+ throw new DependencyCollectorException( e.getMessage(), e );
+ }
+ }
+
+ @Override
+ public CollectorResult collectDependencies( ProjectBuildingRequest buildingRequest, Model root )
+ throws DependencyCollectorException
+ {
+ validateParameters( buildingRequest, root );
+
+ try
+ {
+ return getMavenDependencyCollector( buildingRequest ).collectDependencies( root );
+ }
+ catch ( ComponentLookupException e )
+ {
+ throw new DependencyCollectorException( e.getMessage(), e );
+ }
+ }
+
+ private void validateParameters( ProjectBuildingRequest buildingRequest, DependableCoordinate root )
+ {
+ validateBuildingRequest( buildingRequest );
+ validateRoot( root );
+ }
+
+ private void validateParameters( ProjectBuildingRequest buildingRequest, Dependency root )
+ {
+ validateBuildingRequest( buildingRequest );
+ validateRoot( root );
+ }
+
+ private void validateParameters( ProjectBuildingRequest buildingRequest, Model root )
+ {
+ validateBuildingRequest( buildingRequest );
+ validateRoot( root );
+ }
+
+ private void validateBuildingRequest( ProjectBuildingRequest buildingRequest )
+ {
+ if ( buildingRequest == null )
+ {
+ throw new IllegalArgumentException( "The parameter buildingRequest is not allowed to be null." );
+ }
+ }
+
+ private void validateRoot( Object root )
+ {
+ if ( root == null )
+ {
+ throw new IllegalArgumentException( "The parameter root is not allowed to be null." );
+ }
+ }
+
+ /**
+ * @return true if the current Maven version is Maven 3.1.
+ */
+ private boolean isMaven31()
+ {
+ try
+ {
+ // Maven 3.1 specific
+ Thread.currentThread().getContextClassLoader().loadClass( "org.eclipse.aether.artifact.Artifact" );
+ return true;
+ }
+ catch ( ClassNotFoundException e )
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Injects the Plexus content.
+ *
+ * @param context Plexus context to inject.
+ * @throws ContextException if the PlexusContainer could not be located.
+ */
+ public void contextualize( Context context ) throws ContextException
+ {
+ container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
+ }
+
+ private MavenDependencyCollector getMavenDependencyCollector( ProjectBuildingRequest buildingRequest )
+ throws ComponentLookupException, DependencyCollectorException
+ {
+ ArtifactHandlerManager artifactHandlerManager = container.lookup( ArtifactHandlerManager.class );
+
+ if ( isMaven31() )
+ {
+ org.eclipse.aether.RepositorySystem m31RepositorySystem = container.lookup(
+ org.eclipse.aether.RepositorySystem.class );
+
+ org.eclipse.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
+ "getRepositorySession" );
+
+ List<org.eclipse.aether.repository.RemoteRepository> aetherRepositories = Invoker.invoke(
+ RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() );
+
+ return new Maven31DependencyCollector( m31RepositorySystem, artifactHandlerManager, session,
+ aetherRepositories );
+ }
+ else
+ {
+
+ org.sonatype.aether.RepositorySystem m30RepositorySystem = container.lookup(
+ org.sonatype.aether.RepositorySystem.class );
+
+ org.sonatype.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
+ "getRepositorySession" );
+
+ List<org.sonatype.aether.repository.RemoteRepository> aetherRepositories = Invoker.invoke(
+ RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() );
+
+ return new Maven30DependencyCollector( m30RepositorySystem, artifactHandlerManager, session,
+ aetherRepositories );
+ }
+
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Invoker.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Invoker.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Invoker.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Invoker.java
index 45872e9..9f645b6 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Invoker.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Invoker.java
@@ -1,93 +1,93 @@
-package org.apache.maven.shared.transfer.dependencies.collect.internal;
-
-/*
- * 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.shared.transfer.dependencies.collect.DependencyCollectorException;
-
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * Invokes method on objects using reflection.
- */
-final class Invoker
-{
- private Invoker()
- {
- // do not instantiate
- }
-
- public static <T> T invoke( Object object, String method ) throws DependencyCollectorException
- {
- try
- {
- @SuppressWarnings( "unchecked" )
- T invoke = (T) object.getClass().getMethod( method ).invoke( object );
- return invoke;
- }
- catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
- {
- throw new DependencyCollectorException( e.getMessage(), e );
- }
- }
-
- public static <T> T invoke( Class<?> objectClazz, String staticMethod, Class<?> argClazz, Object arg )
- throws DependencyCollectorException
- {
- try
- {
- @SuppressWarnings( "unchecked" )
- T invoke = (T) objectClazz.getMethod( staticMethod, argClazz ).invoke( null, arg );
- return invoke;
- }
- catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
- {
- throw new DependencyCollectorException( e.getMessage(), e );
- }
- }
-
- /**
- * @param objectClazz the class of the static method
- * @param staticMethod the static method to call
- * @param argClasses the classes of the argument, used to select the right static method
- * @param args the actual arguments to be passed
- * @return the result of the method invocation
- * @throws DependencyCollectorException if any checked exception occurs
- */
- public static <T> T invoke( Class<?> objectClazz, String staticMethod, Class<?>[] argClasses, Object[] args )
- throws DependencyCollectorException
- {
- if ( args.length != argClasses.length )
- {
- throw new IllegalArgumentException( "The number of elements in argClasses and args are not the same." );
- }
-
- try
- {
- @SuppressWarnings( "unchecked" )
- T invoke = (T) objectClazz.getMethod( staticMethod, argClasses ).invoke( null, args );
- return invoke;
- }
- catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
- {
- throw new DependencyCollectorException( e.getMessage(), e );
- }
- }
-
-}
+package org.apache.maven.shared.transfer.dependencies.collect.internal;
+
+/*
+ * 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.shared.transfer.dependencies.collect.DependencyCollectorException;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Invokes method on objects using reflection.
+ */
+final class Invoker
+{
+ private Invoker()
+ {
+ // do not instantiate
+ }
+
+ public static <T> T invoke( Object object, String method ) throws DependencyCollectorException
+ {
+ try
+ {
+ @SuppressWarnings( "unchecked" )
+ T invoke = (T) object.getClass().getMethod( method ).invoke( object );
+ return invoke;
+ }
+ catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
+ {
+ throw new DependencyCollectorException( e.getMessage(), e );
+ }
+ }
+
+ public static <T> T invoke( Class<?> objectClazz, String staticMethod, Class<?> argClazz, Object arg )
+ throws DependencyCollectorException
+ {
+ try
+ {
+ @SuppressWarnings( "unchecked" )
+ T invoke = (T) objectClazz.getMethod( staticMethod, argClazz ).invoke( null, arg );
+ return invoke;
+ }
+ catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
+ {
+ throw new DependencyCollectorException( e.getMessage(), e );
+ }
+ }
+
+ /**
+ * @param objectClazz the class of the static method
+ * @param staticMethod the static method to call
+ * @param argClasses the classes of the argument, used to select the right static method
+ * @param args the actual arguments to be passed
+ * @return the result of the method invocation
+ * @throws DependencyCollectorException if any checked exception occurs
+ */
+ public static <T> T invoke( Class<?> objectClazz, String staticMethod, Class<?>[] argClasses, Object[] args )
+ throws DependencyCollectorException
+ {
+ if ( args.length != argClasses.length )
+ {
+ throw new IllegalArgumentException( "The number of elements in argClasses and args are not the same." );
+ }
+
+ try
+ {
+ @SuppressWarnings( "unchecked" )
+ T invoke = (T) objectClazz.getMethod( staticMethod, argClasses ).invoke( null, args );
+ return invoke;
+ }
+ catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
+ {
+ throw new DependencyCollectorException( e.getMessage(), e );
+ }
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30ArtifactRepositoryAdapter.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30ArtifactRepositoryAdapter.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30ArtifactRepositoryAdapter.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30ArtifactRepositoryAdapter.java
index b09ccd4..a51fd56 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30ArtifactRepositoryAdapter.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30ArtifactRepositoryAdapter.java
@@ -1,266 +1,266 @@
-package org.apache.maven.shared.transfer.dependencies.collect.internal;
-
-/*
- * 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 java.util.List;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
-import org.apache.maven.artifact.repository.Authentication;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.apache.maven.repository.Proxy;
-import org.sonatype.aether.repository.RemoteRepository;
-import org.sonatype.aether.repository.RepositoryPolicy;
-
-/**
- * ArtifactRepository wrapper around {@link RemoteRepository}
- *
- * @author Robert Scholte
- *
- */
-class Maven30ArtifactRepositoryAdapter implements ArtifactRepository
-{
-
- private RemoteRepository remoteRepository;
-
- /**
- * @param remoteRepository {@link RemoteRepository}
- */
- Maven30ArtifactRepositoryAdapter( RemoteRepository remoteRepository )
- {
- this.remoteRepository = remoteRepository;
- }
-
- @Override
- public String pathOf( Artifact artifact )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getUrl()
- {
- return remoteRepository.getUrl();
- }
-
- @Override
- public void setUrl( String url )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getBasedir()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getProtocol()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getId()
- {
- return remoteRepository.getId();
- }
-
- @Override
- public void setId( String id )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ArtifactRepositoryPolicy getSnapshots()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ArtifactRepositoryPolicy getReleases()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ArtifactRepositoryLayout getLayout()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setLayout( ArtifactRepositoryLayout layout )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getKey()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isUniqueVersion()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isBlacklisted()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setBlacklisted( boolean blackListed )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Artifact find( Artifact artifact )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public List<String> findVersions( Artifact artifact )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isProjectAware()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setAuthentication( Authentication authentication )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Authentication getAuthentication()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setProxy( Proxy proxy )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Proxy getProxy()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString()
- {
- StringBuilder sb = new StringBuilder();
-
- sb.append( " id: " ).append( getId() ).append( "\n" );
- sb.append( " url: " ).append( getUrl() ).append( "\n" );
- sb.append( " layout: " ).append( "default" ).append( "\n" );
-
- RepositoryPolicy snapshotPolicy = remoteRepository.getPolicy( true );
- sb.append( "snapshots: [enabled => " ).append( snapshotPolicy.isEnabled() );
- sb.append( ", update => " ).append( snapshotPolicy.getUpdatePolicy() ).append( "]\n" );
-
- RepositoryPolicy releasePolicy = remoteRepository.getPolicy( false );
- sb.append( " releases: [enabled => " ).append( releasePolicy.isEnabled() );
- sb.append( ", update => " ).append( releasePolicy.getUpdatePolicy() ).append( "]\n" );
-
- return sb.toString();
- }
-
-
- @Override
- public int hashCode()
- {
- return remoteRepository.hashCode();
- }
-
- @Override
- public boolean equals( Object obj )
- {
- if ( this == obj )
- {
- return true;
- }
- if ( obj == null )
- {
- return false;
- }
- if ( getClass() != obj.getClass() )
- {
- return false;
- }
-
- Maven30ArtifactRepositoryAdapter other = (Maven30ArtifactRepositoryAdapter) obj;
- if ( remoteRepository == null )
- {
- if ( other.remoteRepository != null )
- {
- return false;
- }
- }
- else if ( !remoteRepository.equals( other.remoteRepository ) )
- {
- return false;
- }
- return true;
- }
-}
+package org.apache.maven.shared.transfer.dependencies.collect.internal;
+
+/*
+ * 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 java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.metadata.ArtifactMetadata;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
+import org.apache.maven.artifact.repository.Authentication;
+import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.repository.Proxy;
+import org.sonatype.aether.repository.RemoteRepository;
+import org.sonatype.aether.repository.RepositoryPolicy;
+
+/**
+ * ArtifactRepository wrapper around {@link RemoteRepository}
+ *
+ * @author Robert Scholte
+ *
+ */
+class Maven30ArtifactRepositoryAdapter implements ArtifactRepository
+{
+
+ private RemoteRepository remoteRepository;
+
+ /**
+ * @param remoteRepository {@link RemoteRepository}
+ */
+ Maven30ArtifactRepositoryAdapter( RemoteRepository remoteRepository )
+ {
+ this.remoteRepository = remoteRepository;
+ }
+
+ @Override
+ public String pathOf( Artifact artifact )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getUrl()
+ {
+ return remoteRepository.getUrl();
+ }
+
+ @Override
+ public void setUrl( String url )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getBasedir()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getProtocol()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getId()
+ {
+ return remoteRepository.getId();
+ }
+
+ @Override
+ public void setId( String id )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ArtifactRepositoryPolicy getSnapshots()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ArtifactRepositoryPolicy getReleases()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ArtifactRepositoryLayout getLayout()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setLayout( ArtifactRepositoryLayout layout )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getKey()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isUniqueVersion()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isBlacklisted()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setBlacklisted( boolean blackListed )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Artifact find( Artifact artifact )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<String> findVersions( Artifact artifact )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isProjectAware()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setAuthentication( Authentication authentication )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Authentication getAuthentication()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setProxy( Proxy proxy )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Proxy getProxy()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append( " id: " ).append( getId() ).append( "\n" );
+ sb.append( " url: " ).append( getUrl() ).append( "\n" );
+ sb.append( " layout: " ).append( "default" ).append( "\n" );
+
+ RepositoryPolicy snapshotPolicy = remoteRepository.getPolicy( true );
+ sb.append( "snapshots: [enabled => " ).append( snapshotPolicy.isEnabled() );
+ sb.append( ", update => " ).append( snapshotPolicy.getUpdatePolicy() ).append( "]\n" );
+
+ RepositoryPolicy releasePolicy = remoteRepository.getPolicy( false );
+ sb.append( " releases: [enabled => " ).append( releasePolicy.isEnabled() );
+ sb.append( ", update => " ).append( releasePolicy.getUpdatePolicy() ).append( "]\n" );
+
+ return sb.toString();
+ }
+
+
+ @Override
+ public int hashCode()
+ {
+ return remoteRepository.hashCode();
+ }
+
+ @Override
+ public boolean equals( Object obj )
+ {
+ if ( this == obj )
+ {
+ return true;
+ }
+ if ( obj == null )
+ {
+ return false;
+ }
+ if ( getClass() != obj.getClass() )
+ {
+ return false;
+ }
+
+ Maven30ArtifactRepositoryAdapter other = (Maven30ArtifactRepositoryAdapter) obj;
+ if ( remoteRepository == null )
+ {
+ if ( other.remoteRepository != null )
+ {
+ return false;
+ }
+ }
+ else if ( !remoteRepository.equals( other.remoteRepository ) )
+ {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30CollectorResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30CollectorResult.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30CollectorResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30CollectorResult.java
index 081dd66..926bfe6 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30CollectorResult.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30CollectorResult.java
@@ -1,85 +1,85 @@
-package org.apache.maven.shared.transfer.dependencies.collect.internal;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.shared.transfer.dependencies.collect.CollectorResult;
-import org.sonatype.aether.collection.CollectResult;
-import org.sonatype.aether.graph.DependencyNode;
-import org.sonatype.aether.graph.DependencyVisitor;
-import org.sonatype.aether.repository.RemoteRepository;
-
-/**
- * CollectorResult wrapper around {@link CollectResult}
- *
- * @author Robert Scholte
- *
- */
-class Maven30CollectorResult implements CollectorResult
-{
- private final CollectResult collectResult;
-
- /**
- * @param collectResult {@link CollectorResult}
- */
- Maven30CollectorResult( CollectResult collectResult )
- {
- this.collectResult = collectResult;
- }
-
- @Override
- public List<ArtifactRepository> getRemoteRepositories()
- {
- final Set<RemoteRepository> aetherRepositories = new HashSet<>();
-
- DependencyVisitor visitor = new DependencyVisitor()
- {
- @Override
- public boolean visitEnter( DependencyNode node )
- {
- aetherRepositories.addAll( node.getRepositories() );
- return true;
- }
-
- @Override
- public boolean visitLeave( DependencyNode node )
- {
- return true;
- }
- };
-
- collectResult.getRoot().accept( visitor );
-
- List<ArtifactRepository> mavenRepositories = new ArrayList<>( aetherRepositories.size() );
-
- for ( RemoteRepository aetherRepository : aetherRepositories )
- {
- mavenRepositories.add( new Maven30ArtifactRepositoryAdapter( aetherRepository ) );
- }
-
- return mavenRepositories;
- }
-
-}
+package org.apache.maven.shared.transfer.dependencies.collect.internal;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.shared.transfer.dependencies.collect.CollectorResult;
+import org.sonatype.aether.collection.CollectResult;
+import org.sonatype.aether.graph.DependencyNode;
+import org.sonatype.aether.graph.DependencyVisitor;
+import org.sonatype.aether.repository.RemoteRepository;
+
+/**
+ * CollectorResult wrapper around {@link CollectResult}
+ *
+ * @author Robert Scholte
+ *
+ */
+class Maven30CollectorResult implements CollectorResult
+{
+ private final CollectResult collectResult;
+
+ /**
+ * @param collectResult {@link CollectorResult}
+ */
+ Maven30CollectorResult( CollectResult collectResult )
+ {
+ this.collectResult = collectResult;
+ }
+
+ @Override
+ public List<ArtifactRepository> getRemoteRepositories()
+ {
+ final Set<RemoteRepository> aetherRepositories = new HashSet<>();
+
+ DependencyVisitor visitor = new DependencyVisitor()
+ {
+ @Override
+ public boolean visitEnter( DependencyNode node )
+ {
+ aetherRepositories.addAll( node.getRepositories() );
+ return true;
+ }
+
+ @Override
+ public boolean visitLeave( DependencyNode node )
+ {
+ return true;
+ }
+ };
+
+ collectResult.getRoot().accept( visitor );
+
+ List<ArtifactRepository> mavenRepositories = new ArrayList<>( aetherRepositories.size() );
+
+ for ( RemoteRepository aetherRepository : aetherRepositories )
+ {
+ mavenRepositories.add( new Maven30ArtifactRepositoryAdapter( aetherRepository ) );
+ }
+
+ return mavenRepositories;
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30DependencyCollector.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30DependencyCollector.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30DependencyCollector.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30DependencyCollector.java
index 8a85003..aa54ac1 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30DependencyCollector.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30DependencyCollector.java
@@ -1,160 +1,160 @@
-package org.apache.maven.shared.transfer.dependencies.collect.internal;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.List;
-
-import org.apache.maven.RepositoryUtils;
-import org.apache.maven.artifact.handler.ArtifactHandler;
-import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
-import org.apache.maven.model.Model;
-import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
-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;
-import org.sonatype.aether.RepositorySystem;
-import org.sonatype.aether.RepositorySystemSession;
-import org.sonatype.aether.artifact.Artifact;
-import org.sonatype.aether.artifact.ArtifactTypeRegistry;
-import org.sonatype.aether.collection.CollectRequest;
-import org.sonatype.aether.collection.DependencyCollectionException;
-import org.sonatype.aether.graph.Dependency;
-import org.sonatype.aether.repository.RemoteRepository;
-import org.sonatype.aether.util.artifact.DefaultArtifact;
-
-/**
- * Maven 3.0 implementation of the {@link DependencyCollector}
- *
- * @author Robert Scholte
- */
-class Maven30DependencyCollector implements MavenDependencyCollector
-{
- private final RepositorySystem repositorySystem;
-
- private final ArtifactHandlerManager artifactHandlerManager;
-
- private final RepositorySystemSession session;
-
- private final List<RemoteRepository> aetherRepositories;
-
- Maven30DependencyCollector( RepositorySystem repositorySystem, ArtifactHandlerManager artifactHandlerManager,
- RepositorySystemSession session, List<RemoteRepository> aetherRepositories )
- {
- super();
- this.repositorySystem = repositorySystem;
- this.artifactHandlerManager = artifactHandlerManager;
- this.session = session;
- this.aetherRepositories = aetherRepositories;
- }
-
- private static Dependency toDependency( org.apache.maven.model.Dependency mavenDependency,
- ArtifactTypeRegistry typeRegistry ) throws DependencyCollectorException
- {
- Class<?>[] argClasses = new Class<?>[] {org.apache.maven.model.Dependency.class, ArtifactTypeRegistry.class};
-
- Object[] args = new Object[] {mavenDependency, typeRegistry};
-
- return Invoker.invoke( RepositoryUtils.class, "toDependency", argClasses, args );
- }
-
- @Override
- public CollectorResult collectDependencies( org.apache.maven.model.Dependency root )
- throws DependencyCollectorException
- {
- ArtifactTypeRegistry typeRegistry = Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
- ArtifactHandlerManager.class, artifactHandlerManager );
-
- CollectRequest request = new CollectRequest();
- request.setRoot( toDependency( root, typeRegistry ) );
-
- return collectDependencies( request );
- }
-
- @Override
- public CollectorResult collectDependencies( DependableCoordinate root ) throws DependencyCollectorException
- {
- ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getType() );
-
- String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
-
- Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), root.getClassifier(),
- extension, root.getVersion() );
-
- CollectRequest request = new CollectRequest();
- request.setRoot( new Dependency( aetherArtifact, null ) );
-
- return collectDependencies( request );
- }
-
- @Override
- public CollectorResult collectDependencies( Model root ) throws DependencyCollectorException
- {
- // Are there examples where packaging and type are NOT in sync
- ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getPackaging() );
-
- String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
-
- Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), extension,
- root.getVersion() );
-
- CollectRequest request = new CollectRequest();
- request.setRoot( new Dependency( aetherArtifact, null ) );
-
- ArtifactTypeRegistry typeRegistry = Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
- ArtifactHandlerManager.class, artifactHandlerManager );
-
- List<Dependency> aetherDependencies = new ArrayList<>( root.getDependencies().size() );
- for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencies() )
- {
- aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) );
- }
- request.setDependencies( aetherDependencies );
-
- if ( root.getDependencyManagement() != null )
- {
- List<Dependency> aetherManagerDependencies = new ArrayList<>(
- root.getDependencyManagement().getDependencies().size() );
-
- for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencyManagement().getDependencies() )
- {
- aetherManagerDependencies.add( toDependency( mavenDependency, typeRegistry ) );
- }
-
- request.setManagedDependencies( aetherManagerDependencies );
- }
-
- return collectDependencies( request );
- }
-
- private CollectorResult collectDependencies( CollectRequest request ) throws DependencyCollectorException
- {
- request.setRepositories( aetherRepositories );
-
- try
- {
- return new Maven30CollectorResult( repositorySystem.collectDependencies( session, request ) );
- }
- catch ( DependencyCollectionException e )
- {
- throw new DependencyCollectorException( e.getMessage(), e );
- }
- }
-}
+package org.apache.maven.shared.transfer.dependencies.collect.internal;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.RepositoryUtils;
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.model.Model;
+import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
+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;
+import org.sonatype.aether.RepositorySystem;
+import org.sonatype.aether.RepositorySystemSession;
+import org.sonatype.aether.artifact.Artifact;
+import org.sonatype.aether.artifact.ArtifactTypeRegistry;
+import org.sonatype.aether.collection.CollectRequest;
+import org.sonatype.aether.collection.DependencyCollectionException;
+import org.sonatype.aether.graph.Dependency;
+import org.sonatype.aether.repository.RemoteRepository;
+import org.sonatype.aether.util.artifact.DefaultArtifact;
+
+/**
+ * Maven 3.0 implementation of the {@link DependencyCollector}
+ *
+ * @author Robert Scholte
+ */
+class Maven30DependencyCollector implements MavenDependencyCollector
+{
+ private final RepositorySystem repositorySystem;
+
+ private final ArtifactHandlerManager artifactHandlerManager;
+
+ private final RepositorySystemSession session;
+
+ private final List<RemoteRepository> aetherRepositories;
+
+ Maven30DependencyCollector( RepositorySystem repositorySystem, ArtifactHandlerManager artifactHandlerManager,
+ RepositorySystemSession session, List<RemoteRepository> aetherRepositories )
+ {
+ super();
+ this.repositorySystem = repositorySystem;
+ this.artifactHandlerManager = artifactHandlerManager;
+ this.session = session;
+ this.aetherRepositories = aetherRepositories;
+ }
+
+ private static Dependency toDependency( org.apache.maven.model.Dependency mavenDependency,
+ ArtifactTypeRegistry typeRegistry ) throws DependencyCollectorException
+ {
+ Class<?>[] argClasses = new Class<?>[] {org.apache.maven.model.Dependency.class, ArtifactTypeRegistry.class};
+
+ Object[] args = new Object[] {mavenDependency, typeRegistry};
+
+ return Invoker.invoke( RepositoryUtils.class, "toDependency", argClasses, args );
+ }
+
+ @Override
+ public CollectorResult collectDependencies( org.apache.maven.model.Dependency root )
+ throws DependencyCollectorException
+ {
+ ArtifactTypeRegistry typeRegistry = Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
+ ArtifactHandlerManager.class, artifactHandlerManager );
+
+ CollectRequest request = new CollectRequest();
+ request.setRoot( toDependency( root, typeRegistry ) );
+
+ return collectDependencies( request );
+ }
+
+ @Override
+ public CollectorResult collectDependencies( DependableCoordinate root ) throws DependencyCollectorException
+ {
+ ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getType() );
+
+ String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
+
+ Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), root.getClassifier(),
+ extension, root.getVersion() );
+
+ CollectRequest request = new CollectRequest();
+ request.setRoot( new Dependency( aetherArtifact, null ) );
+
+ return collectDependencies( request );
+ }
+
+ @Override
+ public CollectorResult collectDependencies( Model root ) throws DependencyCollectorException
+ {
+ // Are there examples where packaging and type are NOT in sync
+ ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getPackaging() );
+
+ String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
+
+ Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), extension,
+ root.getVersion() );
+
+ CollectRequest request = new CollectRequest();
+ request.setRoot( new Dependency( aetherArtifact, null ) );
+
+ ArtifactTypeRegistry typeRegistry = Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
+ ArtifactHandlerManager.class, artifactHandlerManager );
+
+ List<Dependency> aetherDependencies = new ArrayList<>( root.getDependencies().size() );
+ for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencies() )
+ {
+ aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) );
+ }
+ request.setDependencies( aetherDependencies );
+
+ if ( root.getDependencyManagement() != null )
+ {
+ List<Dependency> aetherManagerDependencies = new ArrayList<>(
+ root.getDependencyManagement().getDependencies().size() );
+
+ for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencyManagement().getDependencies() )
+ {
+ aetherManagerDependencies.add( toDependency( mavenDependency, typeRegistry ) );
+ }
+
+ request.setManagedDependencies( aetherManagerDependencies );
+ }
+
+ return collectDependencies( request );
+ }
+
+ private CollectorResult collectDependencies( CollectRequest request ) throws DependencyCollectorException
+ {
+ request.setRepositories( aetherRepositories );
+
+ try
+ {
+ return new Maven30CollectorResult( repositorySystem.collectDependencies( session, request ) );
+ }
+ catch ( DependencyCollectionException e )
+ {
+ throw new DependencyCollectorException( e.getMessage(), e );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30DependencyNodeAdapter.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30DependencyNodeAdapter.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30DependencyNodeAdapter.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven30DependencyNodeAdapter.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31ArtifactRepositoryAdapter.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31ArtifactRepositoryAdapter.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31ArtifactRepositoryAdapter.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31ArtifactRepositoryAdapter.java
index 854cf4a..f450dfd 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31ArtifactRepositoryAdapter.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31ArtifactRepositoryAdapter.java
@@ -1,266 +1,266 @@
-package org.apache.maven.shared.transfer.dependencies.collect.internal;
-
-/*
- * 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 java.util.List;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
-import org.apache.maven.artifact.repository.Authentication;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.apache.maven.repository.Proxy;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.repository.RepositoryPolicy;
-
-/**
- * ArtifactRepository wrapper around {@link RemoteRepository}
- *
- * @author Robert Scholte
- *
- */
-class Maven31ArtifactRepositoryAdapter implements ArtifactRepository
-{
-
- private RemoteRepository remoteRepository;
-
- /**
- * @param remoteRepository {@link RemoteRepository}
- */
- Maven31ArtifactRepositoryAdapter( RemoteRepository remoteRepository )
- {
- this.remoteRepository = remoteRepository;
- }
-
- @Override
- public String pathOf( Artifact artifact )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getUrl()
- {
- return remoteRepository.getUrl();
- }
-
- @Override
- public void setUrl( String url )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getBasedir()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getProtocol()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getId()
- {
- return remoteRepository.getId();
- }
-
- @Override
- public void setId( String id )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ArtifactRepositoryPolicy getSnapshots()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ArtifactRepositoryPolicy getReleases()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public ArtifactRepositoryLayout getLayout()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setLayout( ArtifactRepositoryLayout layout )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getKey()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isUniqueVersion()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isBlacklisted()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setBlacklisted( boolean blackListed )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Artifact find( Artifact artifact )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public List<String> findVersions( Artifact artifact )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isProjectAware()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setAuthentication( Authentication authentication )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Authentication getAuthentication()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setProxy( Proxy proxy )
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Proxy getProxy()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString()
- {
- StringBuilder sb = new StringBuilder();
-
- sb.append( " id: " ).append( getId() ).append( "\n" );
- sb.append( " url: " ).append( getUrl() ).append( "\n" );
- sb.append( " layout: " ).append( "default" ).append( "\n" );
-
- RepositoryPolicy snapshotPolicy = remoteRepository.getPolicy( true );
- sb.append( "snapshots: [enabled => " ).append( snapshotPolicy.isEnabled() );
- sb.append( ", update => " ).append( snapshotPolicy.getUpdatePolicy() ).append( "]\n" );
-
- RepositoryPolicy releasePolicy = remoteRepository.getPolicy( false );
- sb.append( " releases: [enabled => " ).append( releasePolicy.isEnabled() );
- sb.append( ", update => " ).append( releasePolicy.getUpdatePolicy() ).append( "]\n" );
-
- return sb.toString();
- }
-
-
- @Override
- public int hashCode()
- {
- return remoteRepository.hashCode();
- }
-
- @Override
- public boolean equals( Object obj )
- {
- if ( this == obj )
- {
- return true;
- }
- if ( obj == null )
- {
- return false;
- }
- if ( getClass() != obj.getClass() )
- {
- return false;
- }
-
- Maven31ArtifactRepositoryAdapter other = (Maven31ArtifactRepositoryAdapter) obj;
- if ( remoteRepository == null )
- {
- if ( other.remoteRepository != null )
- {
- return false;
- }
- }
- else if ( !remoteRepository.equals( other.remoteRepository ) )
- {
- return false;
- }
- return true;
- }
-}
+package org.apache.maven.shared.transfer.dependencies.collect.internal;
+
+/*
+ * 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 java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.metadata.ArtifactMetadata;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
+import org.apache.maven.artifact.repository.Authentication;
+import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.repository.Proxy;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.repository.RepositoryPolicy;
+
+/**
+ * ArtifactRepository wrapper around {@link RemoteRepository}
+ *
+ * @author Robert Scholte
+ *
+ */
+class Maven31ArtifactRepositoryAdapter implements ArtifactRepository
+{
+
+ private RemoteRepository remoteRepository;
+
+ /**
+ * @param remoteRepository {@link RemoteRepository}
+ */
+ Maven31ArtifactRepositoryAdapter( RemoteRepository remoteRepository )
+ {
+ this.remoteRepository = remoteRepository;
+ }
+
+ @Override
+ public String pathOf( Artifact artifact )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getUrl()
+ {
+ return remoteRepository.getUrl();
+ }
+
+ @Override
+ public void setUrl( String url )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getBasedir()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getProtocol()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getId()
+ {
+ return remoteRepository.getId();
+ }
+
+ @Override
+ public void setId( String id )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ArtifactRepositoryPolicy getSnapshots()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ArtifactRepositoryPolicy getReleases()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public ArtifactRepositoryLayout getLayout()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setLayout( ArtifactRepositoryLayout layout )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getKey()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isUniqueVersion()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isBlacklisted()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setBlacklisted( boolean blackListed )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Artifact find( Artifact artifact )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public List<String> findVersions( Artifact artifact )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isProjectAware()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setAuthentication( Authentication authentication )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Authentication getAuthentication()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setProxy( Proxy proxy )
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Proxy getProxy()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append( " id: " ).append( getId() ).append( "\n" );
+ sb.append( " url: " ).append( getUrl() ).append( "\n" );
+ sb.append( " layout: " ).append( "default" ).append( "\n" );
+
+ RepositoryPolicy snapshotPolicy = remoteRepository.getPolicy( true );
+ sb.append( "snapshots: [enabled => " ).append( snapshotPolicy.isEnabled() );
+ sb.append( ", update => " ).append( snapshotPolicy.getUpdatePolicy() ).append( "]\n" );
+
+ RepositoryPolicy releasePolicy = remoteRepository.getPolicy( false );
+ sb.append( " releases: [enabled => " ).append( releasePolicy.isEnabled() );
+ sb.append( ", update => " ).append( releasePolicy.getUpdatePolicy() ).append( "]\n" );
+
+ return sb.toString();
+ }
+
+
+ @Override
+ public int hashCode()
+ {
+ return remoteRepository.hashCode();
+ }
+
+ @Override
+ public boolean equals( Object obj )
+ {
+ if ( this == obj )
+ {
+ return true;
+ }
+ if ( obj == null )
+ {
+ return false;
+ }
+ if ( getClass() != obj.getClass() )
+ {
+ return false;
+ }
+
+ Maven31ArtifactRepositoryAdapter other = (Maven31ArtifactRepositoryAdapter) obj;
+ if ( remoteRepository == null )
+ {
+ if ( other.remoteRepository != null )
+ {
+ return false;
+ }
+ }
+ else if ( !remoteRepository.equals( other.remoteRepository ) )
+ {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31CollectorResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31CollectorResult.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31CollectorResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31CollectorResult.java
index dbf8717..c1a4e6f 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31CollectorResult.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31CollectorResult.java
@@ -1,85 +1,85 @@
-package org.apache.maven.shared.transfer.dependencies.collect.internal;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.shared.transfer.dependencies.collect.CollectorResult;
-import org.eclipse.aether.collection.CollectResult;
-import org.eclipse.aether.graph.DependencyNode;
-import org.eclipse.aether.graph.DependencyVisitor;
-import org.eclipse.aether.repository.RemoteRepository;
-
-/**
- * CollectorResult wrapper around {@link CollectResult}
- *
- * @author Robert Scholte
- *
- */
-class Maven31CollectorResult implements CollectorResult
-{
- private final CollectResult collectResult;
-
- /**
- * @param collectResult {@link CollectorResult}
- */
- Maven31CollectorResult( CollectResult collectResult )
- {
- this.collectResult = collectResult;
- }
-
- @Override
- public List<ArtifactRepository> getRemoteRepositories()
- {
- final Set<RemoteRepository> aetherRepositories = new HashSet<>();
-
- DependencyVisitor visitor = new DependencyVisitor()
- {
- @Override
- public boolean visitEnter( DependencyNode node )
- {
- aetherRepositories.addAll( node.getRepositories() );
- return true;
- }
-
- @Override
- public boolean visitLeave( DependencyNode node )
- {
- return true;
- }
- };
-
- collectResult.getRoot().accept( visitor );
-
- List<ArtifactRepository> mavenRepositories = new ArrayList<>( aetherRepositories.size() );
-
- for ( RemoteRepository aetherRepository : aetherRepositories )
- {
- mavenRepositories.add( new Maven31ArtifactRepositoryAdapter( aetherRepository ) );
- }
-
- return mavenRepositories;
- }
-
-}
+package org.apache.maven.shared.transfer.dependencies.collect.internal;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.shared.transfer.dependencies.collect.CollectorResult;
+import org.eclipse.aether.collection.CollectResult;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.graph.DependencyVisitor;
+import org.eclipse.aether.repository.RemoteRepository;
+
+/**
+ * CollectorResult wrapper around {@link CollectResult}
+ *
+ * @author Robert Scholte
+ *
+ */
+class Maven31CollectorResult implements CollectorResult
+{
+ private final CollectResult collectResult;
+
+ /**
+ * @param collectResult {@link CollectorResult}
+ */
+ Maven31CollectorResult( CollectResult collectResult )
+ {
+ this.collectResult = collectResult;
+ }
+
+ @Override
+ public List<ArtifactRepository> getRemoteRepositories()
+ {
+ final Set<RemoteRepository> aetherRepositories = new HashSet<>();
+
+ DependencyVisitor visitor = new DependencyVisitor()
+ {
+ @Override
+ public boolean visitEnter( DependencyNode node )
+ {
+ aetherRepositories.addAll( node.getRepositories() );
+ return true;
+ }
+
+ @Override
+ public boolean visitLeave( DependencyNode node )
+ {
+ return true;
+ }
+ };
+
+ collectResult.getRoot().accept( visitor );
+
+ List<ArtifactRepository> mavenRepositories = new ArrayList<>( aetherRepositories.size() );
+
+ for ( RemoteRepository aetherRepository : aetherRepositories )
+ {
+ mavenRepositories.add( new Maven31ArtifactRepositoryAdapter( aetherRepository ) );
+ }
+
+ return mavenRepositories;
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31DependencyCollector.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31DependencyCollector.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31DependencyCollector.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31DependencyCollector.java
index 50f3700..1ca1920 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31DependencyCollector.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31DependencyCollector.java
@@ -1,160 +1,160 @@
-package org.apache.maven.shared.transfer.dependencies.collect.internal;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.List;
-
-import org.apache.maven.RepositoryUtils;
-import org.apache.maven.artifact.handler.ArtifactHandler;
-import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
-import org.apache.maven.model.Model;
-import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
-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;
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.artifact.ArtifactTypeRegistry;
-import org.eclipse.aether.artifact.DefaultArtifact;
-import org.eclipse.aether.collection.CollectRequest;
-import org.eclipse.aether.collection.DependencyCollectionException;
-import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.repository.RemoteRepository;
-
-/**
- * Maven 3.1+ implementation of the {@link DependencyCollector}
- *
- * @author Robert Scholte
- */
-class Maven31DependencyCollector implements MavenDependencyCollector
-{
- private final RepositorySystem repositorySystem;
-
- private final ArtifactHandlerManager artifactHandlerManager;
-
- private final RepositorySystemSession session;
-
- private final List<RemoteRepository> aetherRepositories;
-
- Maven31DependencyCollector( RepositorySystem repositorySystem, ArtifactHandlerManager artifactHandlerManager,
- RepositorySystemSession session, List<RemoteRepository> aetherRepositories )
- {
- super();
- this.repositorySystem = repositorySystem;
- this.artifactHandlerManager = artifactHandlerManager;
- this.session = session;
- this.aetherRepositories = aetherRepositories;
- }
-
- private static Dependency toDependency( org.apache.maven.model.Dependency mavenDependency,
- ArtifactTypeRegistry typeRegistry ) throws DependencyCollectorException
- {
- Class<?>[] argClasses = new Class<?>[] {org.apache.maven.model.Dependency.class, ArtifactTypeRegistry.class};
-
- Object[] args = new Object[] {mavenDependency, typeRegistry};
-
- return Invoker.invoke( RepositoryUtils.class, "toDependency", argClasses, args );
- }
-
- @Override
- public CollectorResult collectDependencies( org.apache.maven.model.Dependency root )
- throws DependencyCollectorException
- {
- ArtifactTypeRegistry typeRegistry = Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
- ArtifactHandlerManager.class, artifactHandlerManager );
-
- CollectRequest request = new CollectRequest();
- request.setRoot( toDependency( root, typeRegistry ) );
-
- return collectDependencies( request );
- }
-
- @Override
- public CollectorResult collectDependencies( DependableCoordinate root ) throws DependencyCollectorException
- {
- ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getType() );
-
- String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
-
- Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), root.getClassifier(),
- extension, root.getVersion() );
-
- CollectRequest request = new CollectRequest();
- request.setRoot( new Dependency( aetherArtifact, null ) );
-
- return collectDependencies( request );
- }
-
- @Override
- public CollectorResult collectDependencies( Model root ) throws DependencyCollectorException
- {
- // Are there examples where packaging and type are NOT in sync
- ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getPackaging() );
-
- String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
-
- Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), extension,
- root.getVersion() );
-
- CollectRequest request = new CollectRequest();
- request.setRoot( new Dependency( aetherArtifact, null ) );
-
- ArtifactTypeRegistry typeRegistry = Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
- ArtifactHandlerManager.class, artifactHandlerManager );
-
- List<Dependency> aetherDependencies = new ArrayList<>( root.getDependencies().size() );
- for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencies() )
- {
- aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) );
- }
- request.setDependencies( aetherDependencies );
-
- if ( root.getDependencyManagement() != null )
- {
- List<Dependency> aetherManagerDependencies = new ArrayList<>(
- root.getDependencyManagement().getDependencies().size() );
-
- for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencyManagement().getDependencies() )
- {
- aetherManagerDependencies.add( toDependency( mavenDependency, typeRegistry ) );
- }
-
- request.setManagedDependencies( aetherManagerDependencies );
- }
-
- return collectDependencies( request );
- }
-
- private CollectorResult collectDependencies( CollectRequest request ) throws DependencyCollectorException
- {
- request.setRepositories( aetherRepositories );
-
- try
- {
- return new Maven31CollectorResult( repositorySystem.collectDependencies( session, request ) );
- }
- catch ( DependencyCollectionException e )
- {
- throw new DependencyCollectorException( e.getMessage(), e );
- }
- }
-}
+package org.apache.maven.shared.transfer.dependencies.collect.internal;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.RepositoryUtils;
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.model.Model;
+import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
+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;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.ArtifactTypeRegistry;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.collection.DependencyCollectionException;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.repository.RemoteRepository;
+
+/**
+ * Maven 3.1+ implementation of the {@link DependencyCollector}
+ *
+ * @author Robert Scholte
+ */
+class Maven31DependencyCollector implements MavenDependencyCollector
+{
+ private final RepositorySystem repositorySystem;
+
+ private final ArtifactHandlerManager artifactHandlerManager;
+
+ private final RepositorySystemSession session;
+
+ private final List<RemoteRepository> aetherRepositories;
+
+ Maven31DependencyCollector( RepositorySystem repositorySystem, ArtifactHandlerManager artifactHandlerManager,
+ RepositorySystemSession session, List<RemoteRepository> aetherRepositories )
+ {
+ super();
+ this.repositorySystem = repositorySystem;
+ this.artifactHandlerManager = artifactHandlerManager;
+ this.session = session;
+ this.aetherRepositories = aetherRepositories;
+ }
+
+ private static Dependency toDependency( org.apache.maven.model.Dependency mavenDependency,
+ ArtifactTypeRegistry typeRegistry ) throws DependencyCollectorException
+ {
+ Class<?>[] argClasses = new Class<?>[] {org.apache.maven.model.Dependency.class, ArtifactTypeRegistry.class};
+
+ Object[] args = new Object[] {mavenDependency, typeRegistry};
+
+ return Invoker.invoke( RepositoryUtils.class, "toDependency", argClasses, args );
+ }
+
+ @Override
+ public CollectorResult collectDependencies( org.apache.maven.model.Dependency root )
+ throws DependencyCollectorException
+ {
+ ArtifactTypeRegistry typeRegistry = Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
+ ArtifactHandlerManager.class, artifactHandlerManager );
+
+ CollectRequest request = new CollectRequest();
+ request.setRoot( toDependency( root, typeRegistry ) );
+
+ return collectDependencies( request );
+ }
+
+ @Override
+ public CollectorResult collectDependencies( DependableCoordinate root ) throws DependencyCollectorException
+ {
+ ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getType() );
+
+ String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
+
+ Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), root.getClassifier(),
+ extension, root.getVersion() );
+
+ CollectRequest request = new CollectRequest();
+ request.setRoot( new Dependency( aetherArtifact, null ) );
+
+ return collectDependencies( request );
+ }
+
+ @Override
+ public CollectorResult collectDependencies( Model root ) throws DependencyCollectorException
+ {
+ // Are there examples where packaging and type are NOT in sync
+ ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( root.getPackaging() );
+
+ String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
+
+ Artifact aetherArtifact = new DefaultArtifact( root.getGroupId(), root.getArtifactId(), extension,
+ root.getVersion() );
+
+ CollectRequest request = new CollectRequest();
+ request.setRoot( new Dependency( aetherArtifact, null ) );
+
+ ArtifactTypeRegistry typeRegistry = Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry",
+ ArtifactHandlerManager.class, artifactHandlerManager );
+
+ List<Dependency> aetherDependencies = new ArrayList<>( root.getDependencies().size() );
+ for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencies() )
+ {
+ aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) );
+ }
+ request.setDependencies( aetherDependencies );
+
+ if ( root.getDependencyManagement() != null )
+ {
+ List<Dependency> aetherManagerDependencies = new ArrayList<>(
+ root.getDependencyManagement().getDependencies().size() );
+
+ for ( org.apache.maven.model.Dependency mavenDependency : root.getDependencyManagement().getDependencies() )
+ {
+ aetherManagerDependencies.add( toDependency( mavenDependency, typeRegistry ) );
+ }
+
+ request.setManagedDependencies( aetherManagerDependencies );
+ }
+
+ return collectDependencies( request );
+ }
+
+ private CollectorResult collectDependencies( CollectRequest request ) throws DependencyCollectorException
+ {
+ request.setRepositories( aetherRepositories );
+
+ try
+ {
+ return new Maven31CollectorResult( repositorySystem.collectDependencies( session, request ) );
+ }
+ catch ( DependencyCollectionException e )
+ {
+ throw new DependencyCollectorException( e.getMessage(), e );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31DependencyNodeAdapter.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31DependencyNodeAdapter.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31DependencyNodeAdapter.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/Maven31DependencyNodeAdapter.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/MavenDependencyCollector.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/MavenDependencyCollector.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/MavenDependencyCollector.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/MavenDependencyCollector.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolver.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolver.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolver.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolver.java
index 23baf51..041a613 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolver.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolver.java
@@ -1,81 +1,81 @@
-package org.apache.maven.shared.transfer.dependencies.resolve;
-
-/*
- * 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 java.util.Collection;
-
-import org.apache.maven.model.Dependency;
-import org.apache.maven.model.Model;
-import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
-import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult;
-import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
-
-/**
- * @author Robert Scholte
- */
-public interface DependencyResolver
-{
- /**
- * This will resolve the dependencies of the coordinate, not resolving the the artifact of the coordinate itself. If
- * the coordinate needs to be resolved too, use
- * {@link #resolveDependencies(ProjectBuildingRequest, Collection, Collection, TransformableFilter)} passing
- * {@code Collections.singletonList(coordinate)}
- *
- * @param buildingRequest {@link ProjectBuildingRequest}
- * @param coordinate {@link DependableCoordinate}
- * @param filter {@link TransformableFilter} (can be {@code null}).
- * @return the resolved dependencies.
- * @throws DependencyResolverException in case of an error.
- */
- Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest,
- DependableCoordinate coordinate, TransformableFilter filter )
- throws DependencyResolverException;
-
- /**
- * This will resolve the dependencies of the coordinate, not resolving the the artifact of the coordinate itself. If
- * the coordinate needs to be resolved too, use
- * {@link #resolveDependencies(ProjectBuildingRequest, Collection, Collection, TransformableFilter)} passing
- * {@code Collections.singletonList(coordinate)}
- *
- * @param buildingRequest {@link ProjectBuildingRequest}
- * @param model {@link Model}
- * @param filter {@link TransformableFilter} (can be {@code null}).
- * @return the resolved dependencies.
- * @throws DependencyResolverException in case of an error.
- */
- Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest, Model model,
- TransformableFilter filter )
- throws DependencyResolverException;
-
- /**
- * @param buildingRequest the project building request, never {@code null}
- * @param dependencies the dependencies to resolve, can be {@code null}
- * @param managedDependencies managed dependencies, can be {@code null}
- * @param filter a filter, can be {@code null}
- * @return the resolved dependencies.
- * @throws DependencyResolverException in case of an error.
- */
- Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest,
- Collection<Dependency> dependencies,
- Collection<Dependency> managedDependencies,
- TransformableFilter filter )
- throws DependencyResolverException;
-}
+package org.apache.maven.shared.transfer.dependencies.resolve;
+
+/*
+ * 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 java.util.Collection;
+
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult;
+import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
+
+/**
+ * @author Robert Scholte
+ */
+public interface DependencyResolver
+{
+ /**
+ * This will resolve the dependencies of the coordinate, not resolving the the artifact of the coordinate itself. If
+ * the coordinate needs to be resolved too, use
+ * {@link #resolveDependencies(ProjectBuildingRequest, Collection, Collection, TransformableFilter)} passing
+ * {@code Collections.singletonList(coordinate)}
+ *
+ * @param buildingRequest {@link ProjectBuildingRequest}
+ * @param coordinate {@link DependableCoordinate}
+ * @param filter {@link TransformableFilter} (can be {@code null}).
+ * @return the resolved dependencies.
+ * @throws DependencyResolverException in case of an error.
+ */
+ Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest,
+ DependableCoordinate coordinate, TransformableFilter filter )
+ throws DependencyResolverException;
+
+ /**
+ * This will resolve the dependencies of the coordinate, not resolving the the artifact of the coordinate itself. If
+ * the coordinate needs to be resolved too, use
+ * {@link #resolveDependencies(ProjectBuildingRequest, Collection, Collection, TransformableFilter)} passing
+ * {@code Collections.singletonList(coordinate)}
+ *
+ * @param buildingRequest {@link ProjectBuildingRequest}
+ * @param model {@link Model}
+ * @param filter {@link TransformableFilter} (can be {@code null}).
+ * @return the resolved dependencies.
+ * @throws DependencyResolverException in case of an error.
+ */
+ Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest, Model model,
+ TransformableFilter filter )
+ throws DependencyResolverException;
+
+ /**
+ * @param buildingRequest the project building request, never {@code null}
+ * @param dependencies the dependencies to resolve, can be {@code null}
+ * @param managedDependencies managed dependencies, can be {@code null}
+ * @param filter a filter, can be {@code null}
+ * @return the resolved dependencies.
+ * @throws DependencyResolverException in case of an error.
+ */
+ Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest,
+ Collection<Dependency> dependencies,
+ Collection<Dependency> managedDependencies,
+ TransformableFilter filter )
+ throws DependencyResolverException;
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolverException.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolverException.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolverException.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolverException.java
index 0235cdf..d6ca1ac 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolverException.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolverException.java
@@ -1,54 +1,54 @@
-package org.apache.maven.shared.transfer.dependencies.resolve;
-
-/*
- * 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.
- */
-
-/**
- * The Exception class in case a resolving does not work.
- */
-public class DependencyResolverException
- extends Exception
-{
- private static final long serialVersionUID = 5320065249974323888L;
-
- /**
- * @param cause The {@link Exception cause} of the problem.
- */
- protected DependencyResolverException( Exception cause )
- {
- super( cause );
- }
-
- /**
- * @param message The message to give.
- * @param e The {@link Exception}.
- */
- public DependencyResolverException( String message, Exception e )
- {
- super( message, e );
- }
-
- /**
- * @return {@link DependencyResult}
- */
- public DependencyResult getResult()
- {
- return null;
- }
-}
+package org.apache.maven.shared.transfer.dependencies.resolve;
+
+/*
+ * 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.
+ */
+
+/**
+ * The Exception class in case a resolving does not work.
+ */
+public class DependencyResolverException
+ extends Exception
+{
+ private static final long serialVersionUID = 5320065249974323888L;
+
+ /**
+ * @param cause The {@link Exception cause} of the problem.
+ */
+ protected DependencyResolverException( Exception cause )
+ {
+ super( cause );
+ }
+
+ /**
+ * @param message The message to give.
+ * @param e The {@link Exception}.
+ */
+ public DependencyResolverException( String message, Exception e )
+ {
+ super( message, e );
+ }
+
+ /**
+ * @return {@link DependencyResult}
+ */
+ public DependencyResult getResult()
+ {
+ return null;
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResult.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResult.java
index f839b05..7d76d2f 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResult.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResult.java
@@ -1,37 +1,37 @@
-package org.apache.maven.shared.transfer.dependencies.resolve;
-
-/*
- * 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 java.util.List;
-
-/**
- *
- * @author Robert Scholte
- *
- */
-public interface DependencyResult
-{
- /**
- * Gets the exceptions that occurred while building the dependency graph.
- *
- * @return The list of exceptions {@link Exception}.
- */
- List<Exception> getCollectorExceptions();
-}
+package org.apache.maven.shared.transfer.dependencies.resolve;
+
+/*
+ * 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 java.util.List;
+
+/**
+ *
+ * @author Robert Scholte
+ *
+ */
+public interface DependencyResult
+{
+ /**
+ * Gets the exceptions that occurred while building the dependency graph.
+ *
+ * @return The list of exceptions {@link Exception}.
+ */
+ List<Exception> getCollectorExceptions();
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java
index 7718c19..28289a8 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java
@@ -1,190 +1,190 @@
-package org.apache.maven.shared.transfer.dependencies.resolve.internal;
-
-/*
- * 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 java.util.Collection;
-import java.util.List;
-
-import org.apache.maven.RepositoryUtils;
-import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.model.Model;
-import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
-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.DependencyResolver;
-import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
-import org.codehaus.plexus.PlexusConstants;
-import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
-import org.codehaus.plexus.context.Context;
-import org.codehaus.plexus.context.ContextException;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
-
-/**
- *
- */
-@Component( role = DependencyResolver.class, hint = "default" )
-class DefaultDependencyResolver implements DependencyResolver, Contextualizable
-{
- private PlexusContainer container;
-
- @Override
- public Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest,
- Collection<Dependency> coordinates, Collection<Dependency> managedDependencies, TransformableFilter filter )
- throws DependencyResolverException
- {
- validateBuildingRequest( buildingRequest );
-
- try
- {
- return getMavenDependencyResolver( buildingRequest ).resolveDependencies( coordinates, managedDependencies,
- filter );
- }
- catch ( ComponentLookupException e )
- {
- throw new DependencyResolverException( e.getMessage(), e );
- }
- }
-
- @Override
- public Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest,
- DependableCoordinate coordinate, TransformableFilter filter ) throws DependencyResolverException
- {
- validateParameters( buildingRequest, coordinate );
- try
- {
- return getMavenDependencyResolver( buildingRequest ).resolveDependencies( coordinate, filter );
- }
- catch ( ComponentLookupException e )
- {
- throw new DependencyResolverException( e.getMessage(), e );
- }
- }
-
- @Override
- public Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest, Model model,
- TransformableFilter filter ) throws DependencyResolverException
- {
- validateParameters( buildingRequest, model );
- try
- {
- return getMavenDependencyResolver( buildingRequest ).resolveDependencies( model, filter );
- }
- catch ( ComponentLookupException e )
- {
- throw new DependencyResolverException( e.getMessage(), e );
- }
- }
-
- /**
- * @return true if the current Maven version is Maven 3.1.
- */
- private boolean isMaven31()
- {
- try
- {
- // Maven 3.1 specific
- Thread.currentThread().getContextClassLoader().loadClass( "org.eclipse.aether.artifact.Artifact" );
- return true;
- }
- catch ( ClassNotFoundException e )
- {
- return false;
- }
- }
-
- /**
- * Injects the Plexus content.
- *
- * @param context Plexus context to inject.
- * @throws ContextException if the PlexusContainer could not be located.
- */
- public void contextualize( Context context ) throws ContextException
- {
- container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
- }
-
- private void validateParameters( ProjectBuildingRequest buildingRequest, DependableCoordinate coordinate )
- {
- validateBuildingRequest( buildingRequest );
- if ( coordinate == null )
- {
- throw new IllegalArgumentException( "The parameter coordinate is not allowed to be null." );
- }
- }
-
- private void validateParameters( ProjectBuildingRequest buildingRequest, Model model )
- {
- validateBuildingRequest( buildingRequest );
- if ( model == null )
- {
- throw new IllegalArgumentException( "The parameter model is not allowed to be null." );
- }
-
- }
-
- private MavenDependencyResolver getMavenDependencyResolver( ProjectBuildingRequest buildingRequest )
- throws ComponentLookupException, DependencyResolverException
- {
- ArtifactHandlerManager artifactHandlerManager = container.lookup( ArtifactHandlerManager.class );
-
- if ( isMaven31() )
- {
- org.eclipse.aether.RepositorySystem m31RepositorySystem = container.lookup(
- org.eclipse.aether.RepositorySystem.class );
-
- org.eclipse.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
- "getRepositorySession" );
-
- List<org.eclipse.aether.repository.RemoteRepository> aetherRepositories = Invoker.invoke(
- RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() );
-
- return new Maven31DependencyResolver( m31RepositorySystem, artifactHandlerManager, session,
- aetherRepositories );
- }
- else
- {
- org.sonatype.aether.RepositorySystem m30RepositorySystem = container.lookup(
- org.sonatype.aether.RepositorySystem.class );
-
- org.sonatype.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
- "getRepositorySession" );
-
- List<org.sonatype.aether.repository.RemoteRepository> aetherRepositories = Invoker.invoke(
- RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() );
-
- return new Maven30DependencyResolver( m30RepositorySystem, artifactHandlerManager, session,
- aetherRepositories );
-
- }
- }
-
- private void validateBuildingRequest( ProjectBuildingRequest buildingRequest )
- {
- if ( buildingRequest == null )
- {
- throw new IllegalArgumentException( "The parameter buildingRequest is not allowed to be null." );
- }
- }
-
-}
+package org.apache.maven.shared.transfer.dependencies.resolve.internal;
+
+/*
+ * 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 java.util.Collection;
+import java.util.List;
+
+import org.apache.maven.RepositoryUtils;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
+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.DependencyResolver;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+
+/**
+ *
+ */
+@Component( role = DependencyResolver.class, hint = "default" )
+class DefaultDependencyResolver implements DependencyResolver, Contextualizable
+{
+ private PlexusContainer container;
+
+ @Override
+ public Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest,
+ Collection<Dependency> coordinates, Collection<Dependency> managedDependencies, TransformableFilter filter )
+ throws DependencyResolverException
+ {
+ validateBuildingRequest( buildingRequest );
+
+ try
+ {
+ return getMavenDependencyResolver( buildingRequest ).resolveDependencies( coordinates, managedDependencies,
+ filter );
+ }
+ catch ( ComponentLookupException e )
+ {
+ throw new DependencyResolverException( e.getMessage(), e );
+ }
+ }
+
+ @Override
+ public Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest,
+ DependableCoordinate coordinate, TransformableFilter filter ) throws DependencyResolverException
+ {
+ validateParameters( buildingRequest, coordinate );
+ try
+ {
+ return getMavenDependencyResolver( buildingRequest ).resolveDependencies( coordinate, filter );
+ }
+ catch ( ComponentLookupException e )
+ {
+ throw new DependencyResolverException( e.getMessage(), e );
+ }
+ }
+
+ @Override
+ public Iterable<ArtifactResult> resolveDependencies( ProjectBuildingRequest buildingRequest, Model model,
+ TransformableFilter filter ) throws DependencyResolverException
+ {
+ validateParameters( buildingRequest, model );
+ try
+ {
+ return getMavenDependencyResolver( buildingRequest ).resolveDependencies( model, filter );
+ }
+ catch ( ComponentLookupException e )
+ {
+ throw new DependencyResolverException( e.getMessage(), e );
+ }
+ }
+
+ /**
+ * @return true if the current Maven version is Maven 3.1.
+ */
+ private boolean isMaven31()
+ {
+ try
+ {
+ // Maven 3.1 specific
+ Thread.currentThread().getContextClassLoader().loadClass( "org.eclipse.aether.artifact.Artifact" );
+ return true;
+ }
+ catch ( ClassNotFoundException e )
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Injects the Plexus content.
+ *
+ * @param context Plexus context to inject.
+ * @throws ContextException if the PlexusContainer could not be located.
+ */
+ public void contextualize( Context context ) throws ContextException
+ {
+ container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
+ }
+
+ private void validateParameters( ProjectBuildingRequest buildingRequest, DependableCoordinate coordinate )
+ {
+ validateBuildingRequest( buildingRequest );
+ if ( coordinate == null )
+ {
+ throw new IllegalArgumentException( "The parameter coordinate is not allowed to be null." );
+ }
+ }
+
+ private void validateParameters( ProjectBuildingRequest buildingRequest, Model model )
+ {
+ validateBuildingRequest( buildingRequest );
+ if ( model == null )
+ {
+ throw new IllegalArgumentException( "The parameter model is not allowed to be null." );
+ }
+
+ }
+
+ private MavenDependencyResolver getMavenDependencyResolver( ProjectBuildingRequest buildingRequest )
+ throws ComponentLookupException, DependencyResolverException
+ {
+ ArtifactHandlerManager artifactHandlerManager = container.lookup( ArtifactHandlerManager.class );
+
+ if ( isMaven31() )
+ {
+ org.eclipse.aether.RepositorySystem m31RepositorySystem = container.lookup(
+ org.eclipse.aether.RepositorySystem.class );
+
+ org.eclipse.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
+ "getRepositorySession" );
+
+ List<org.eclipse.aether.repository.RemoteRepository> aetherRepositories = Invoker.invoke(
+ RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() );
+
+ return new Maven31DependencyResolver( m31RepositorySystem, artifactHandlerManager, session,
+ aetherRepositories );
+ }
+ else
+ {
+ org.sonatype.aether.RepositorySystem m30RepositorySystem = container.lookup(
+ org.sonatype.aether.RepositorySystem.class );
+
+ org.sonatype.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
+ "getRepositorySession" );
+
+ List<org.sonatype.aether.repository.RemoteRepository> aetherRepositories = Invoker.invoke(
+ RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() );
+
+ return new Maven30DependencyResolver( m30RepositorySystem, artifactHandlerManager, session,
+ aetherRepositories );
+
+ }
+ }
+
+ private void validateBuildingRequest( ProjectBuildingRequest buildingRequest )
+ {
+ if ( buildingRequest == null )
+ {
+ throw new IllegalArgumentException( "The parameter buildingRequest is not allowed to be null." );
+ }
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Invoker.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Invoker.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Invoker.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Invoker.java
index dc7ad4c..e4dfb82 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Invoker.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Invoker.java
@@ -1,95 +1,95 @@
-package org.apache.maven.shared.transfer.dependencies.resolve.internal;
-
-/*
- * 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 java.lang.reflect.InvocationTargetException;
-
-import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
-
-/**
- * Invokes method on objects using reflection.
- */
-final class Invoker
-{
- private Invoker()
- {
- // do not instantiate
- }
-
- public static <T> T invoke( Object object, String method )
- throws DependencyResolverException
- {
- try
- {
- @SuppressWarnings( "unchecked" )
- T invoke = (T) object.getClass().getMethod( method ).invoke( object );
- return invoke;
- }
- catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
- {
- throw new DependencyResolverException( e.getMessage(), e );
- }
- }
-
- public static <T> T invoke( Class<?> objectClazz, String staticMethod, Class<?> argClazz, Object arg )
- throws DependencyResolverException
- {
- try
- {
- @SuppressWarnings( "unchecked" )
- T invoke = (T) objectClazz.getMethod( staticMethod, argClazz ).invoke( null, arg );
- return invoke;
- }
- catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
- {
- throw new DependencyResolverException( e.getMessage(), e );
- }
- }
-
- /**
- * <strong>Note:</strong> Ensure that argClasses and args have the same number of elements
- *
- * @param objectClazz the class of the static method
- * @param staticMethod the static method to call
- * @param argClasses the classes of the argument, used to select the right static method
- * @param args the actual arguments to be passed
- * @return the result of the method invocation
- * @throws DependencyResolverException if any checked exception occurs
- */
- public static <T> T invoke( Class<?> objectClazz, String staticMethod, Class<?>[] argClasses, Object[] args )
- throws DependencyResolverException
- {
- if ( args.length != argClasses.length )
- {
- throw new IllegalArgumentException( "The number of elements in argClasses and args are not the same." );
- }
-
- try
- {
- @SuppressWarnings( "unchecked" )
- T invoke = (T) objectClazz.getMethod( staticMethod, argClasses ).invoke( null, args );
- return invoke;
- }
- catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
- {
- throw new DependencyResolverException( e.getMessage(), e );
- }
- }
-}
+package org.apache.maven.shared.transfer.dependencies.resolve.internal;
+
+/*
+ * 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 java.lang.reflect.InvocationTargetException;
+
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
+
+/**
+ * Invokes method on objects using reflection.
+ */
+final class Invoker
+{
+ private Invoker()
+ {
+ // do not instantiate
+ }
+
+ public static <T> T invoke( Object object, String method )
+ throws DependencyResolverException
+ {
+ try
+ {
+ @SuppressWarnings( "unchecked" )
+ T invoke = (T) object.getClass().getMethod( method ).invoke( object );
+ return invoke;
+ }
+ catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
+ {
+ throw new DependencyResolverException( e.getMessage(), e );
+ }
+ }
+
+ public static <T> T invoke( Class<?> objectClazz, String staticMethod, Class<?> argClazz, Object arg )
+ throws DependencyResolverException
+ {
+ try
+ {
+ @SuppressWarnings( "unchecked" )
+ T invoke = (T) objectClazz.getMethod( staticMethod, argClazz ).invoke( null, arg );
+ return invoke;
+ }
+ catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
+ {
+ throw new DependencyResolverException( e.getMessage(), e );
+ }
+ }
+
+ /**
+ * <strong>Note:</strong> Ensure that argClasses and args have the same number of elements
+ *
+ * @param objectClazz the class of the static method
+ * @param staticMethod the static method to call
+ * @param argClasses the classes of the argument, used to select the right static method
+ * @param args the actual arguments to be passed
+ * @return the result of the method invocation
+ * @throws DependencyResolverException if any checked exception occurs
+ */
+ public static <T> T invoke( Class<?> objectClazz, String staticMethod, Class<?>[] argClasses, Object[] args )
+ throws DependencyResolverException
+ {
+ if ( args.length != argClasses.length )
+ {
+ throw new IllegalArgumentException( "The number of elements in argClasses and args are not the same." );
+ }
+
+ try
+ {
+ @SuppressWarnings( "unchecked" )
+ T invoke = (T) objectClazz.getMethod( staticMethod, argClasses ).invoke( null, args );
+ return invoke;
+ }
+ catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e )
+ {
+ throw new DependencyResolverException( e.getMessage(), e );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30ArtifactResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30ArtifactResult.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30ArtifactResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30ArtifactResult.java
index b9f37d9..b0aafdf 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30ArtifactResult.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30ArtifactResult.java
@@ -1,57 +1,57 @@
-package org.apache.maven.shared.transfer.dependencies.resolve.internal;
-
-/*
- * 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.RepositoryUtils;
-import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
-import org.sonatype.aether.artifact.Artifact;
-import org.sonatype.aether.resolution.ArtifactResult;
-
-/**
- * {@link org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult} wrapper for {@link ArtifactResult}
- *
- * @author Robert Scholte
- * @since 3.0
- */
-class Maven30ArtifactResult implements org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult
-{
- private final ArtifactResult artifactResult;
-
- /**
- * @param artifactResult {@link ArtifactResult}
- */
- Maven30ArtifactResult( ArtifactResult artifactResult )
- {
- this.artifactResult = artifactResult;
- }
-
- @Override
- public org.apache.maven.artifact.Artifact getArtifact()
- {
- try
- {
- return Invoker.invoke( RepositoryUtils.class, "toArtifact", Artifact.class, artifactResult.getArtifact() );
- }
- catch ( DependencyResolverException e )
- {
- throw new RuntimeException( e );
- }
- }
-}
+package org.apache.maven.shared.transfer.dependencies.resolve.internal;
+
+/*
+ * 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.RepositoryUtils;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
+import org.sonatype.aether.artifact.Artifact;
+import org.sonatype.aether.resolution.ArtifactResult;
+
+/**
+ * {@link org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult} wrapper for {@link ArtifactResult}
+ *
+ * @author Robert Scholte
+ * @since 3.0
+ */
+class Maven30ArtifactResult implements org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult
+{
+ private final ArtifactResult artifactResult;
+
+ /**
+ * @param artifactResult {@link ArtifactResult}
+ */
+ Maven30ArtifactResult( ArtifactResult artifactResult )
+ {
+ this.artifactResult = artifactResult;
+ }
+
+ @Override
+ public org.apache.maven.artifact.Artifact getArtifact()
+ {
+ try
+ {
+ return Invoker.invoke( RepositoryUtils.class, "toArtifact", Artifact.class, artifactResult.getArtifact() );
+ }
+ catch ( DependencyResolverException e )
+ {
+ throw new RuntimeException( e );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolver.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolver.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolver.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolver.java
index 031d604..f6730ae 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolver.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolver.java
@@ -1,247 +1,247 @@
-package org.apache.maven.shared.transfer.dependencies.resolve.internal;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.maven.RepositoryUtils;
-import org.apache.maven.artifact.handler.ArtifactHandler;
-import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
-import org.apache.maven.model.DependencyManagement;
-import org.apache.maven.model.Model;
-import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
-import org.apache.maven.shared.artifact.filter.resolve.transform.SonatypeAetherFilterTransformer;
-import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
-import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
-import org.sonatype.aether.RepositorySystem;
-import org.sonatype.aether.RepositorySystemSession;
-import org.sonatype.aether.artifact.Artifact;
-import org.sonatype.aether.artifact.ArtifactType;
-import org.sonatype.aether.artifact.ArtifactTypeRegistry;
-import org.sonatype.aether.collection.CollectRequest;
-import org.sonatype.aether.collection.DependencyCollectionException;
-import org.sonatype.aether.graph.Dependency;
-import org.sonatype.aether.graph.DependencyFilter;
-import org.sonatype.aether.repository.RemoteRepository;
-import org.sonatype.aether.resolution.ArtifactResolutionException;
-import org.sonatype.aether.resolution.ArtifactResult;
-import org.sonatype.aether.util.artifact.DefaultArtifact;
-import org.sonatype.aether.util.artifact.DefaultArtifactType;
-
-/**
- *
- */
-class Maven30DependencyResolver implements MavenDependencyResolver
-{
- private static final Class<?>[] ARG_CLASSES = new Class<?>[] {org.apache.maven.model.Dependency.class,
- ArtifactTypeRegistry.class};
- private final RepositorySystem repositorySystem;
- private final ArtifactHandlerManager artifactHandlerManager;
- private final RepositorySystemSession session;
- private final List<RemoteRepository> aetherRepositories;
-
- Maven30DependencyResolver( RepositorySystem repositorySystem, ArtifactHandlerManager artifactHandlerManager,
- RepositorySystemSession session, List<RemoteRepository> aetherRepositories )
- {
- super();
- this.repositorySystem = repositorySystem;
- this.artifactHandlerManager = artifactHandlerManager;
- this.session = session;
- this.aetherRepositories = aetherRepositories;
- }
-
- /**
- * Based on RepositoryUtils#toDependency(org.apache.maven.model.Dependency, ArtifactTypeRegistry)
- *
- * @param coordinate {@link DependableCoordinate}
- * @param stereotypes {@link org.eclipse.aether.artifact.ArtifactTypeRegistry
- * @return as Aether Dependency
- */
- private static Dependency toDependency( DependableCoordinate coordinate, ArtifactTypeRegistry stereotypes )
- {
- ArtifactType stereotype = stereotypes.get( coordinate.getType() );
- if ( stereotype == null )
- {
- stereotype = new DefaultArtifactType( coordinate.getType() );
- }
-
- Artifact artifact = new DefaultArtifact( coordinate.getGroupId(), coordinate.getArtifactId(),
- coordinate.getClassifier(), null, coordinate.getVersion(), null, stereotype );
-
- return new Dependency( artifact, null );
- }
-
- private static Dependency toDependency( org.apache.maven.model.Dependency mavenDependency,
- ArtifactTypeRegistry typeRegistry ) throws DependencyResolverException
- {
- Object[] args = new Object[] {mavenDependency, typeRegistry};
-
- return Invoker.invoke( RepositoryUtils.class, "toDependency", ARG_CLASSES, args );
- }
-
- @Override
- // CHECKSTYLE_OFF: LineLength
- public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
- DependableCoordinate coordinate, TransformableFilter dependencyFilter )
- // CHECKSTYLE_ON: LineLength
- throws DependencyResolverException
- {
- ArtifactTypeRegistry typeRegistry = createTypeRegistry();
-
- Dependency aetherRoot = toDependency( coordinate, typeRegistry );
-
- CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories );
-
- return resolveDependencies( dependencyFilter, request );
- }
-
- private ArtifactTypeRegistry createTypeRegistry() throws DependencyResolverException
- {
- return Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry", ArtifactHandlerManager.class,
- artifactHandlerManager );
- }
-
- @Override
- // CHECKSTYLE_OFF: LineLength
- public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies( Model model,
- TransformableFilter dependencyFilter )
- // CHECKSTYLE_ON: LineLength
- throws DependencyResolverException
- {
- // Are there examples where packaging and type are NOT in sync
- ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( model.getPackaging() );
-
- String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
-
- Artifact aetherArtifact = new DefaultArtifact( model.getGroupId(), model.getArtifactId(), extension,
- model.getVersion() );
-
- Dependency aetherRoot = new Dependency( aetherArtifact, null );
-
- CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories );
-
- request.setDependencies( resolveDependencies( model.getDependencies() ) );
-
- DependencyManagement mavenDependencyManagement = model.getDependencyManagement();
- if ( mavenDependencyManagement != null )
- {
- request.setManagedDependencies( resolveDependencies( mavenDependencyManagement.getDependencies() ) );
- }
-
- return resolveDependencies( dependencyFilter, request );
- }
-
- /**
- * @param mavenDependencies {@link org.apache.maven.model.Dependency} can be {@code null}.
- * @return List of resolved dependencies.
- * @throws DependencyResolverException in case of a failure of the typeRegistry error.
- */
- // CHECKSTYLE_OFF: LineLength
- private List<Dependency> resolveDependencies( Collection<org.apache.maven.model.Dependency> mavenDependencies )
- throws DependencyResolverException
- // CHECKSTYLE_ON: LineLength
- {
- if ( mavenDependencies == null )
- {
- return Collections.emptyList();
- }
-
- ArtifactTypeRegistry typeRegistry = createTypeRegistry();
-
- List<Dependency> aetherDependencies = new ArrayList<>( mavenDependencies.size() );
-
- for ( org.apache.maven.model.Dependency mavenDependency : mavenDependencies )
- {
- aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) );
- }
-
- return aetherDependencies;
- }
-
- @Override
- // CHECKSTYLE_OFF: LineLength
- public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
- Collection<org.apache.maven.model.Dependency> mavenDependencies,
- Collection<org.apache.maven.model.Dependency> managedMavenDependencies, TransformableFilter filter )
- // CHECKSTYLE_ON: LineLength
- throws DependencyResolverException
- {
-
- List<Dependency> aetherDependencies = resolveDependencies( mavenDependencies );
-
- List<Dependency> aetherManagedDependencies = resolveDependencies( managedMavenDependencies );
-
- CollectRequest request = new CollectRequest( aetherDependencies, aetherManagedDependencies,
- aetherRepositories );
-
- return resolveDependencies( filter, request );
- }
-
- // CHECKSTYLE_OFF: LineLength
- private Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
- TransformableFilter dependencyFilter, CollectRequest request ) throws DependencyResolverException
- // CHECKSTYLE_ON :LineLength
- {
- try
- {
- DependencyFilter depFilter = null;
- if ( dependencyFilter != null )
- {
- depFilter = dependencyFilter.transform( new SonatypeAetherFilterTransformer() );
- }
-
- final List<ArtifactResult> dependencyResults = repositorySystem.resolveDependencies( session, request,
- depFilter );
-
- // Keep it lazy! Often artifactsResults aren't used, so transforming up front is too expensive
- return new Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult>()
- {
- @Override
- public Iterator<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> iterator()
- {
- // CHECKSTYLE_OFF: LineLength
- Collection<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> artResults =
- new ArrayList<>(
- dependencyResults.size() );
- // CHECKSTYLE_ON: LineLength
-
- for ( ArtifactResult artifactResult : dependencyResults )
- {
- artResults.add( new Maven30ArtifactResult( artifactResult ) );
- }
-
- return artResults.iterator();
- }
- };
- }
- catch ( ArtifactResolutionException e )
- {
- throw new Maven30DependencyResolverException( e );
- }
- catch ( DependencyCollectionException e )
- {
- throw new Maven30DependencyResolverException( e );
- }
- }
-}
+package org.apache.maven.shared.transfer.dependencies.resolve.internal;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.maven.RepositoryUtils;
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.model.DependencyManagement;
+import org.apache.maven.model.Model;
+import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
+import org.apache.maven.shared.artifact.filter.resolve.transform.SonatypeAetherFilterTransformer;
+import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
+import org.sonatype.aether.RepositorySystem;
+import org.sonatype.aether.RepositorySystemSession;
+import org.sonatype.aether.artifact.Artifact;
+import org.sonatype.aether.artifact.ArtifactType;
+import org.sonatype.aether.artifact.ArtifactTypeRegistry;
+import org.sonatype.aether.collection.CollectRequest;
+import org.sonatype.aether.collection.DependencyCollectionException;
+import org.sonatype.aether.graph.Dependency;
+import org.sonatype.aether.graph.DependencyFilter;
+import org.sonatype.aether.repository.RemoteRepository;
+import org.sonatype.aether.resolution.ArtifactResolutionException;
+import org.sonatype.aether.resolution.ArtifactResult;
+import org.sonatype.aether.util.artifact.DefaultArtifact;
+import org.sonatype.aether.util.artifact.DefaultArtifactType;
+
+/**
+ *
+ */
+class Maven30DependencyResolver implements MavenDependencyResolver
+{
+ private static final Class<?>[] ARG_CLASSES = new Class<?>[] {org.apache.maven.model.Dependency.class,
+ ArtifactTypeRegistry.class};
+ private final RepositorySystem repositorySystem;
+ private final ArtifactHandlerManager artifactHandlerManager;
+ private final RepositorySystemSession session;
+ private final List<RemoteRepository> aetherRepositories;
+
+ Maven30DependencyResolver( RepositorySystem repositorySystem, ArtifactHandlerManager artifactHandlerManager,
+ RepositorySystemSession session, List<RemoteRepository> aetherRepositories )
+ {
+ super();
+ this.repositorySystem = repositorySystem;
+ this.artifactHandlerManager = artifactHandlerManager;
+ this.session = session;
+ this.aetherRepositories = aetherRepositories;
+ }
+
+ /**
+ * Based on RepositoryUtils#toDependency(org.apache.maven.model.Dependency, ArtifactTypeRegistry)
+ *
+ * @param coordinate {@link DependableCoordinate}
+ * @param stereotypes {@link org.eclipse.aether.artifact.ArtifactTypeRegistry
+ * @return as Aether Dependency
+ */
+ private static Dependency toDependency( DependableCoordinate coordinate, ArtifactTypeRegistry stereotypes )
+ {
+ ArtifactType stereotype = stereotypes.get( coordinate.getType() );
+ if ( stereotype == null )
+ {
+ stereotype = new DefaultArtifactType( coordinate.getType() );
+ }
+
+ Artifact artifact = new DefaultArtifact( coordinate.getGroupId(), coordinate.getArtifactId(),
+ coordinate.getClassifier(), null, coordinate.getVersion(), null, stereotype );
+
+ return new Dependency( artifact, null );
+ }
+
+ private static Dependency toDependency( org.apache.maven.model.Dependency mavenDependency,
+ ArtifactTypeRegistry typeRegistry ) throws DependencyResolverException
+ {
+ Object[] args = new Object[] {mavenDependency, typeRegistry};
+
+ return Invoker.invoke( RepositoryUtils.class, "toDependency", ARG_CLASSES, args );
+ }
+
+ @Override
+ // CHECKSTYLE_OFF: LineLength
+ public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
+ DependableCoordinate coordinate, TransformableFilter dependencyFilter )
+ // CHECKSTYLE_ON: LineLength
+ throws DependencyResolverException
+ {
+ ArtifactTypeRegistry typeRegistry = createTypeRegistry();
+
+ Dependency aetherRoot = toDependency( coordinate, typeRegistry );
+
+ CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories );
+
+ return resolveDependencies( dependencyFilter, request );
+ }
+
+ private ArtifactTypeRegistry createTypeRegistry() throws DependencyResolverException
+ {
+ return Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry", ArtifactHandlerManager.class,
+ artifactHandlerManager );
+ }
+
+ @Override
+ // CHECKSTYLE_OFF: LineLength
+ public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies( Model model,
+ TransformableFilter dependencyFilter )
+ // CHECKSTYLE_ON: LineLength
+ throws DependencyResolverException
+ {
+ // Are there examples where packaging and type are NOT in sync
+ ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( model.getPackaging() );
+
+ String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
+
+ Artifact aetherArtifact = new DefaultArtifact( model.getGroupId(), model.getArtifactId(), extension,
+ model.getVersion() );
+
+ Dependency aetherRoot = new Dependency( aetherArtifact, null );
+
+ CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories );
+
+ request.setDependencies( resolveDependencies( model.getDependencies() ) );
+
+ DependencyManagement mavenDependencyManagement = model.getDependencyManagement();
+ if ( mavenDependencyManagement != null )
+ {
+ request.setManagedDependencies( resolveDependencies( mavenDependencyManagement.getDependencies() ) );
+ }
+
+ return resolveDependencies( dependencyFilter, request );
+ }
+
+ /**
+ * @param mavenDependencies {@link org.apache.maven.model.Dependency} can be {@code null}.
+ * @return List of resolved dependencies.
+ * @throws DependencyResolverException in case of a failure of the typeRegistry error.
+ */
+ // CHECKSTYLE_OFF: LineLength
+ private List<Dependency> resolveDependencies( Collection<org.apache.maven.model.Dependency> mavenDependencies )
+ throws DependencyResolverException
+ // CHECKSTYLE_ON: LineLength
+ {
+ if ( mavenDependencies == null )
+ {
+ return Collections.emptyList();
+ }
+
+ ArtifactTypeRegistry typeRegistry = createTypeRegistry();
+
+ List<Dependency> aetherDependencies = new ArrayList<>( mavenDependencies.size() );
+
+ for ( org.apache.maven.model.Dependency mavenDependency : mavenDependencies )
+ {
+ aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) );
+ }
+
+ return aetherDependencies;
+ }
+
+ @Override
+ // CHECKSTYLE_OFF: LineLength
+ public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
+ Collection<org.apache.maven.model.Dependency> mavenDependencies,
+ Collection<org.apache.maven.model.Dependency> managedMavenDependencies, TransformableFilter filter )
+ // CHECKSTYLE_ON: LineLength
+ throws DependencyResolverException
+ {
+
+ List<Dependency> aetherDependencies = resolveDependencies( mavenDependencies );
+
+ List<Dependency> aetherManagedDependencies = resolveDependencies( managedMavenDependencies );
+
+ CollectRequest request = new CollectRequest( aetherDependencies, aetherManagedDependencies,
+ aetherRepositories );
+
+ return resolveDependencies( filter, request );
+ }
+
+ // CHECKSTYLE_OFF: LineLength
+ private Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
+ TransformableFilter dependencyFilter, CollectRequest request ) throws DependencyResolverException
+ // CHECKSTYLE_ON :LineLength
+ {
+ try
+ {
+ DependencyFilter depFilter = null;
+ if ( dependencyFilter != null )
+ {
+ depFilter = dependencyFilter.transform( new SonatypeAetherFilterTransformer() );
+ }
+
+ final List<ArtifactResult> dependencyResults = repositorySystem.resolveDependencies( session, request,
+ depFilter );
+
+ // Keep it lazy! Often artifactsResults aren't used, so transforming up front is too expensive
+ return new Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult>()
+ {
+ @Override
+ public Iterator<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> iterator()
+ {
+ // CHECKSTYLE_OFF: LineLength
+ Collection<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> artResults =
+ new ArrayList<>(
+ dependencyResults.size() );
+ // CHECKSTYLE_ON: LineLength
+
+ for ( ArtifactResult artifactResult : dependencyResults )
+ {
+ artResults.add( new Maven30ArtifactResult( artifactResult ) );
+ }
+
+ return artResults.iterator();
+ }
+ };
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ throw new Maven30DependencyResolverException( e );
+ }
+ catch ( DependencyCollectionException e )
+ {
+ throw new Maven30DependencyResolverException( e );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolverException.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolverException.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolverException.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolverException.java
index 699903b..9b5f6fd 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolverException.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven30DependencyResolverException.java
@@ -1,61 +1,61 @@
-package org.apache.maven.shared.transfer.dependencies.resolve.internal;
-
-/*
- * 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 java.util.List;
-
-import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
-import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResult;
-import org.sonatype.aether.collection.DependencyCollectionException;
-import org.sonatype.aether.resolution.ArtifactResolutionException;
-
-/**
- *
- * @author Robert Scholte
- *
- */
-class Maven30DependencyResolverException extends DependencyResolverException
-{
- private DependencyCollectionException dce;
-
- protected Maven30DependencyResolverException( DependencyCollectionException e )
- {
- super( e );
- this.dce = e;
- }
-
- Maven30DependencyResolverException( ArtifactResolutionException e )
- {
- super( e );
- }
-
- @Override
- public DependencyResult getResult()
- {
- return new DependencyResult()
- {
- @Override
- public List<Exception> getCollectorExceptions()
- {
- return dce.getResult().getExceptions();
- }
- };
- }
-}
+package org.apache.maven.shared.transfer.dependencies.resolve.internal;
+
+/*
+ * 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 java.util.List;
+
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResult;
+import org.sonatype.aether.collection.DependencyCollectionException;
+import org.sonatype.aether.resolution.ArtifactResolutionException;
+
+/**
+ *
+ * @author Robert Scholte
+ *
+ */
+class Maven30DependencyResolverException extends DependencyResolverException
+{
+ private DependencyCollectionException dce;
+
+ protected Maven30DependencyResolverException( DependencyCollectionException e )
+ {
+ super( e );
+ this.dce = e;
+ }
+
+ Maven30DependencyResolverException( ArtifactResolutionException e )
+ {
+ super( e );
+ }
+
+ @Override
+ public DependencyResult getResult()
+ {
+ return new DependencyResult()
+ {
+ @Override
+ public List<Exception> getCollectorExceptions()
+ {
+ return dce.getResult().getExceptions();
+ }
+ };
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31ArtifactResult.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31ArtifactResult.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31ArtifactResult.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31ArtifactResult.java
index fe26ce4..48ba799 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31ArtifactResult.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31ArtifactResult.java
@@ -1,59 +1,59 @@
-package org.apache.maven.shared.transfer.dependencies.resolve.internal;
-
-/*
- * 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.RepositoryUtils;
-import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
-import org.eclipse.aether.resolution.ArtifactResult;
-import org.eclipse.aether.artifact.Artifact;
-
-/**
- * {@link org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult} wrapper for {@link ArtifactResult}
- *
- * @author Robert Scholte
- * @since 3.0
- */
-class Maven31ArtifactResult
- implements org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult
-{
- private final ArtifactResult artifactResult;
-
- /**
- * @param artifactResult {@link ArtifactResult}
- */
- Maven31ArtifactResult( ArtifactResult artifactResult )
- {
- this.artifactResult = artifactResult;
- }
-
- @Override
- public org.apache.maven.artifact.Artifact getArtifact()
- {
- try
- {
- return Invoker.invoke( RepositoryUtils.class, "toArtifact",
- Artifact.class, artifactResult.getArtifact() );
- }
- catch ( DependencyResolverException e )
- {
- throw new RuntimeException( e );
- }
- }
-}
+package org.apache.maven.shared.transfer.dependencies.resolve.internal;
+
+/*
+ * 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.RepositoryUtils;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
+import org.eclipse.aether.resolution.ArtifactResult;
+import org.eclipse.aether.artifact.Artifact;
+
+/**
+ * {@link org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult} wrapper for {@link ArtifactResult}
+ *
+ * @author Robert Scholte
+ * @since 3.0
+ */
+class Maven31ArtifactResult
+ implements org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult
+{
+ private final ArtifactResult artifactResult;
+
+ /**
+ * @param artifactResult {@link ArtifactResult}
+ */
+ Maven31ArtifactResult( ArtifactResult artifactResult )
+ {
+ this.artifactResult = artifactResult;
+ }
+
+ @Override
+ public org.apache.maven.artifact.Artifact getArtifact()
+ {
+ try
+ {
+ return Invoker.invoke( RepositoryUtils.class, "toArtifact",
+ Artifact.class, artifactResult.getArtifact() );
+ }
+ catch ( DependencyResolverException e )
+ {
+ throw new RuntimeException( e );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolver.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolver.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolver.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolver.java
index ea35bc5..d735e85 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolver.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolver.java
@@ -1,243 +1,243 @@
-package org.apache.maven.shared.transfer.dependencies.resolve.internal;
-
-/*
- * 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.maven.RepositoryUtils;
-import org.apache.maven.artifact.handler.ArtifactHandler;
-import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
-import org.apache.maven.model.DependencyManagement;
-import org.apache.maven.model.Model;
-import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
-import org.apache.maven.shared.artifact.filter.resolve.transform.EclipseAetherFilterTransformer;
-import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
-import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
-import org.eclipse.aether.RepositorySystem;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.artifact.ArtifactType;
-import org.eclipse.aether.artifact.ArtifactTypeRegistry;
-import org.eclipse.aether.artifact.DefaultArtifact;
-import org.eclipse.aether.artifact.DefaultArtifactType;
-import org.eclipse.aether.collection.CollectRequest;
-import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.graph.DependencyFilter;
-import org.eclipse.aether.repository.RemoteRepository;
-import org.eclipse.aether.resolution.ArtifactResult;
-import org.eclipse.aether.resolution.DependencyRequest;
-import org.eclipse.aether.resolution.DependencyResolutionException;
-import org.eclipse.aether.resolution.DependencyResult;
-
-/**
- *
- */
-class Maven31DependencyResolver implements MavenDependencyResolver
-{
- private static final Class<?>[] ARG_CLASSES = new Class<?>[] {org.apache.maven.model.Dependency.class,
- ArtifactTypeRegistry.class};
- private final RepositorySystem repositorySystem;
- private final ArtifactHandlerManager artifactHandlerManager;
- private final RepositorySystemSession session;
- private final List<RemoteRepository> aetherRepositories;
-
- Maven31DependencyResolver( RepositorySystem repositorySystem, ArtifactHandlerManager artifactHandlerManager,
- RepositorySystemSession session, List<RemoteRepository> aetherRepositories )
- {
- super();
- this.repositorySystem = repositorySystem;
- this.artifactHandlerManager = artifactHandlerManager;
- this.session = session;
- this.aetherRepositories = aetherRepositories;
- }
-
- /**
- * Based on RepositoryUtils#toDependency(org.apache.maven.model.Dependency, ArtifactTypeRegistry)
- *
- * @param coordinate {@link DependableCoordinate}
- * @param stereotypes {@link ArtifactTypeRegistry
- * @return as Aether Dependency
- */
- private static Dependency toDependency( DependableCoordinate coordinate, ArtifactTypeRegistry stereotypes )
- {
- ArtifactType stereotype = stereotypes.get( coordinate.getType() );
- if ( stereotype == null )
- {
- stereotype = new DefaultArtifactType( coordinate.getType() );
- }
-
- Artifact artifact = new DefaultArtifact( coordinate.getGroupId(), coordinate.getArtifactId(),
- coordinate.getClassifier(), null, coordinate.getVersion(), null, stereotype );
-
- return new Dependency( artifact, null );
- }
-
- private static Dependency toDependency( org.apache.maven.model.Dependency root, ArtifactTypeRegistry typeRegistry )
- throws DependencyResolverException
- {
- Object[] args = new Object[] {root, typeRegistry};
-
- return Invoker.invoke( RepositoryUtils.class, "toDependency", ARG_CLASSES, args );
- }
-
- @Override
- // CHECKSTYLE_OFF: LineLength
- public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
- DependableCoordinate coordinate, TransformableFilter dependencyFilter )
- // CHECKSTYLE_ON: LineLength
- throws DependencyResolverException
- {
- ArtifactTypeRegistry typeRegistry = createTypeRegistry();
-
- Dependency aetherRoot = toDependency( coordinate, typeRegistry );
-
- CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories );
-
- return resolveDependencies( dependencyFilter, request );
- }
-
- private ArtifactTypeRegistry createTypeRegistry() throws DependencyResolverException
- {
- return Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry", ArtifactHandlerManager.class,
- artifactHandlerManager );
- }
-
- @Override
- // CHECKSTYLE_OFF: LineLength
- public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies( Model model,
- TransformableFilter dependencyFilter )
- // CHECKSTYLE_ON: LineLength
- throws DependencyResolverException
- {
- // Are there examples where packaging and type are NOT in sync
- ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( model.getPackaging() );
-
- String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
-
- Artifact aetherArtifact = new DefaultArtifact( model.getGroupId(), model.getArtifactId(), extension,
- model.getVersion() );
-
- Dependency aetherRoot = new Dependency( aetherArtifact, null );
-
- CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories );
-
- request.setDependencies( resolveDependencies( model.getDependencies() ) );
-
- DependencyManagement mavenDependencyManagement = model.getDependencyManagement();
- if ( mavenDependencyManagement != null )
- {
- request.setManagedDependencies( resolveDependencies( model.getDependencyManagement().getDependencies() ) );
- }
-
- return resolveDependencies( dependencyFilter, request );
- }
-
- /**
- * @param mavenDependencies {@link org.apache.maven.model.Dependency} can be {@code null}.
- * @return List of resolved dependencies.
- * @throws DependencyResolverException in case of a failure of the typeRegistry error.
- */
- // CHECKSTYLE_OFF: LineLength
- private List<Dependency> resolveDependencies( Collection<org.apache.maven.model.Dependency> mavenDependencies )
- throws DependencyResolverException
- // CHECKSTYLE_ON: LineLength
- {
- if ( mavenDependencies == null )
- {
- return Collections.emptyList();
- }
-
- ArtifactTypeRegistry typeRegistry = createTypeRegistry();
-
- List<Dependency> aetherDependencies = new ArrayList<>( mavenDependencies.size() );
-
- for ( org.apache.maven.model.Dependency mavenDependency : mavenDependencies )
- {
- aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) );
- }
-
- return aetherDependencies;
- }
-
- @Override
- // CHECKSTYLE_OFF: LineLength
- public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
- Collection<org.apache.maven.model.Dependency> mavenDependencies,
- Collection<org.apache.maven.model.Dependency> managedMavenDependencies, TransformableFilter filter )
- // CHECKSTYLE_ON: LineLength
- throws DependencyResolverException
- {
-
- List<Dependency> aetherDeps = resolveDependencies( mavenDependencies );
-
- List<Dependency> aetherManagedDependencies = resolveDependencies( managedMavenDependencies );
-
- CollectRequest request = new CollectRequest( aetherDeps, aetherManagedDependencies, aetherRepositories );
-
- return resolveDependencies( filter, request );
- }
-
- // CHECKSTYLE_OFF: LineLength
- private Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
- TransformableFilter dependencyFilter, CollectRequest request ) throws DependencyResolverException
- // CHECKSTYLE_ON: LineLength
- {
- try
- {
- DependencyFilter depFilter = null;
- if ( dependencyFilter != null )
- {
- depFilter = dependencyFilter.transform( new EclipseAetherFilterTransformer() );
- }
-
- DependencyRequest depRequest = new DependencyRequest( request, depFilter );
-
- final DependencyResult dependencyResults = repositorySystem.resolveDependencies( session, depRequest );
-
- // Keep it lazy! Often artifactsResults aren't used, so transforming up front is too expensive
- return new Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult>()
- {
- @Override
- public Iterator<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> iterator()
- {
- // CHECKSTYLE_OFF: LineLength
- Collection<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> artResults = new ArrayList<>(
- dependencyResults.getArtifactResults().size() );
- // CHECKSTYLE_ON: LineLength
-
- for ( ArtifactResult artifactResult : dependencyResults.getArtifactResults() )
- {
- artResults.add( new Maven31ArtifactResult( artifactResult ) );
- }
-
- return artResults.iterator();
- }
- };
- }
- catch ( DependencyResolutionException e )
- {
- throw new Maven31DependencyResolverException( e );
- }
- }
-}
+package org.apache.maven.shared.transfer.dependencies.resolve.internal;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.maven.RepositoryUtils;
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.model.DependencyManagement;
+import org.apache.maven.model.Model;
+import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
+import org.apache.maven.shared.artifact.filter.resolve.transform.EclipseAetherFilterTransformer;
+import org.apache.maven.shared.transfer.dependencies.DependableCoordinate;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.ArtifactType;
+import org.eclipse.aether.artifact.ArtifactTypeRegistry;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.artifact.DefaultArtifactType;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.graph.DependencyFilter;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.ArtifactResult;
+import org.eclipse.aether.resolution.DependencyRequest;
+import org.eclipse.aether.resolution.DependencyResolutionException;
+import org.eclipse.aether.resolution.DependencyResult;
+
+/**
+ *
+ */
+class Maven31DependencyResolver implements MavenDependencyResolver
+{
+ private static final Class<?>[] ARG_CLASSES = new Class<?>[] {org.apache.maven.model.Dependency.class,
+ ArtifactTypeRegistry.class};
+ private final RepositorySystem repositorySystem;
+ private final ArtifactHandlerManager artifactHandlerManager;
+ private final RepositorySystemSession session;
+ private final List<RemoteRepository> aetherRepositories;
+
+ Maven31DependencyResolver( RepositorySystem repositorySystem, ArtifactHandlerManager artifactHandlerManager,
+ RepositorySystemSession session, List<RemoteRepository> aetherRepositories )
+ {
+ super();
+ this.repositorySystem = repositorySystem;
+ this.artifactHandlerManager = artifactHandlerManager;
+ this.session = session;
+ this.aetherRepositories = aetherRepositories;
+ }
+
+ /**
+ * Based on RepositoryUtils#toDependency(org.apache.maven.model.Dependency, ArtifactTypeRegistry)
+ *
+ * @param coordinate {@link DependableCoordinate}
+ * @param stereotypes {@link ArtifactTypeRegistry
+ * @return as Aether Dependency
+ */
+ private static Dependency toDependency( DependableCoordinate coordinate, ArtifactTypeRegistry stereotypes )
+ {
+ ArtifactType stereotype = stereotypes.get( coordinate.getType() );
+ if ( stereotype == null )
+ {
+ stereotype = new DefaultArtifactType( coordinate.getType() );
+ }
+
+ Artifact artifact = new DefaultArtifact( coordinate.getGroupId(), coordinate.getArtifactId(),
+ coordinate.getClassifier(), null, coordinate.getVersion(), null, stereotype );
+
+ return new Dependency( artifact, null );
+ }
+
+ private static Dependency toDependency( org.apache.maven.model.Dependency root, ArtifactTypeRegistry typeRegistry )
+ throws DependencyResolverException
+ {
+ Object[] args = new Object[] {root, typeRegistry};
+
+ return Invoker.invoke( RepositoryUtils.class, "toDependency", ARG_CLASSES, args );
+ }
+
+ @Override
+ // CHECKSTYLE_OFF: LineLength
+ public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
+ DependableCoordinate coordinate, TransformableFilter dependencyFilter )
+ // CHECKSTYLE_ON: LineLength
+ throws DependencyResolverException
+ {
+ ArtifactTypeRegistry typeRegistry = createTypeRegistry();
+
+ Dependency aetherRoot = toDependency( coordinate, typeRegistry );
+
+ CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories );
+
+ return resolveDependencies( dependencyFilter, request );
+ }
+
+ private ArtifactTypeRegistry createTypeRegistry() throws DependencyResolverException
+ {
+ return Invoker.invoke( RepositoryUtils.class, "newArtifactTypeRegistry", ArtifactHandlerManager.class,
+ artifactHandlerManager );
+ }
+
+ @Override
+ // CHECKSTYLE_OFF: LineLength
+ public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies( Model model,
+ TransformableFilter dependencyFilter )
+ // CHECKSTYLE_ON: LineLength
+ throws DependencyResolverException
+ {
+ // Are there examples where packaging and type are NOT in sync
+ ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler( model.getPackaging() );
+
+ String extension = artifactHandler != null ? artifactHandler.getExtension() : null;
+
+ Artifact aetherArtifact = new DefaultArtifact( model.getGroupId(), model.getArtifactId(), extension,
+ model.getVersion() );
+
+ Dependency aetherRoot = new Dependency( aetherArtifact, null );
+
+ CollectRequest request = new CollectRequest( aetherRoot, aetherRepositories );
+
+ request.setDependencies( resolveDependencies( model.getDependencies() ) );
+
+ DependencyManagement mavenDependencyManagement = model.getDependencyManagement();
+ if ( mavenDependencyManagement != null )
+ {
+ request.setManagedDependencies( resolveDependencies( model.getDependencyManagement().getDependencies() ) );
+ }
+
+ return resolveDependencies( dependencyFilter, request );
+ }
+
+ /**
+ * @param mavenDependencies {@link org.apache.maven.model.Dependency} can be {@code null}.
+ * @return List of resolved dependencies.
+ * @throws DependencyResolverException in case of a failure of the typeRegistry error.
+ */
+ // CHECKSTYLE_OFF: LineLength
+ private List<Dependency> resolveDependencies( Collection<org.apache.maven.model.Dependency> mavenDependencies )
+ throws DependencyResolverException
+ // CHECKSTYLE_ON: LineLength
+ {
+ if ( mavenDependencies == null )
+ {
+ return Collections.emptyList();
+ }
+
+ ArtifactTypeRegistry typeRegistry = createTypeRegistry();
+
+ List<Dependency> aetherDependencies = new ArrayList<>( mavenDependencies.size() );
+
+ for ( org.apache.maven.model.Dependency mavenDependency : mavenDependencies )
+ {
+ aetherDependencies.add( toDependency( mavenDependency, typeRegistry ) );
+ }
+
+ return aetherDependencies;
+ }
+
+ @Override
+ // CHECKSTYLE_OFF: LineLength
+ public Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
+ Collection<org.apache.maven.model.Dependency> mavenDependencies,
+ Collection<org.apache.maven.model.Dependency> managedMavenDependencies, TransformableFilter filter )
+ // CHECKSTYLE_ON: LineLength
+ throws DependencyResolverException
+ {
+
+ List<Dependency> aetherDeps = resolveDependencies( mavenDependencies );
+
+ List<Dependency> aetherManagedDependencies = resolveDependencies( managedMavenDependencies );
+
+ CollectRequest request = new CollectRequest( aetherDeps, aetherManagedDependencies, aetherRepositories );
+
+ return resolveDependencies( filter, request );
+ }
+
+ // CHECKSTYLE_OFF: LineLength
+ private Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> resolveDependencies(
+ TransformableFilter dependencyFilter, CollectRequest request ) throws DependencyResolverException
+ // CHECKSTYLE_ON: LineLength
+ {
+ try
+ {
+ DependencyFilter depFilter = null;
+ if ( dependencyFilter != null )
+ {
+ depFilter = dependencyFilter.transform( new EclipseAetherFilterTransformer() );
+ }
+
+ DependencyRequest depRequest = new DependencyRequest( request, depFilter );
+
+ final DependencyResult dependencyResults = repositorySystem.resolveDependencies( session, depRequest );
+
+ // Keep it lazy! Often artifactsResults aren't used, so transforming up front is too expensive
+ return new Iterable<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult>()
+ {
+ @Override
+ public Iterator<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> iterator()
+ {
+ // CHECKSTYLE_OFF: LineLength
+ Collection<org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult> artResults = new ArrayList<>(
+ dependencyResults.getArtifactResults().size() );
+ // CHECKSTYLE_ON: LineLength
+
+ for ( ArtifactResult artifactResult : dependencyResults.getArtifactResults() )
+ {
+ artResults.add( new Maven31ArtifactResult( artifactResult ) );
+ }
+
+ return artResults.iterator();
+ }
+ };
+ }
+ catch ( DependencyResolutionException e )
+ {
+ throw new Maven31DependencyResolverException( e );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolverException.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolverException.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolverException.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolverException.java
index c892033..ef6185d 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolverException.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/Maven31DependencyResolverException.java
@@ -1,55 +1,55 @@
-package org.apache.maven.shared.transfer.dependencies.resolve.internal;
-
-/*
- * 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 java.util.List;
-
-import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
-import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResult;
-import org.eclipse.aether.resolution.DependencyResolutionException;
-
-/**
- *
- * @author Robert Scholte
- *
- */
-class Maven31DependencyResolverException extends DependencyResolverException
-{
- private DependencyResolutionException e;
-
- Maven31DependencyResolverException( DependencyResolutionException e )
- {
- super( e );
- this.e = e;
- }
-
- @Override
- public DependencyResult getResult()
- {
- return new DependencyResult()
- {
- @Override
- public List<Exception> getCollectorExceptions()
- {
- return e.getResult().getCollectExceptions();
- }
- };
- }
-}
+package org.apache.maven.shared.transfer.dependencies.resolve.internal;
+
+/*
+ * 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 java.util.List;
+
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;
+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResult;
+import org.eclipse.aether.resolution.DependencyResolutionException;
+
+/**
+ *
+ * @author Robert Scholte
+ *
+ */
+class Maven31DependencyResolverException extends DependencyResolverException
+{
+ private DependencyResolutionException e;
+
+ Maven31DependencyResolverException( DependencyResolutionException e )
+ {
+ super( e );
+ this.e = e;
+ }
+
+ @Override
+ public DependencyResult getResult()
+ {
+ return new DependencyResult()
+ {
+ @Override
+ public List<Exception> getCollectorExceptions()
+ {
+ return e.getResult().getCollectExceptions();
+ }
+ };
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/MavenDependencyResolver.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/MavenDependencyResolver.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/MavenDependencyResolver.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/MavenDependencyResolver.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/graph/DependencyNode.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/graph/DependencyNode.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/graph/DependencyNode.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/graph/DependencyNode.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/graph/DependencyVisitor.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/graph/DependencyVisitor.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/graph/DependencyVisitor.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/graph/DependencyVisitor.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/metadata/ArtifactMetadata.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/metadata/ArtifactMetadata.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/metadata/ArtifactMetadata.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/metadata/ArtifactMetadata.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/metadata/internal/Maven30MetadataBridge.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/metadata/internal/Maven30MetadataBridge.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/metadata/internal/Maven30MetadataBridge.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/metadata/internal/Maven30MetadataBridge.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/metadata/internal/Maven31MetadataBridge.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/metadata/internal/Maven31MetadataBridge.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/metadata/internal/Maven31MetadataBridge.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/metadata/internal/Maven31MetadataBridge.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/project/MavenAetherUtils.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/MavenAetherUtils.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/project/MavenAetherUtils.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/MavenAetherUtils.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/project/NoFileAssignedException.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/NoFileAssignedException.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/project/NoFileAssignedException.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/NoFileAssignedException.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/project/deploy/ProjectDeployer.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/deploy/ProjectDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/project/deploy/ProjectDeployer.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/deploy/ProjectDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/project/deploy/ProjectDeployerRequest.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/deploy/ProjectDeployerRequest.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/project/deploy/ProjectDeployerRequest.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/deploy/ProjectDeployerRequest.java
index 206606a..aea581a 100644
--- a/src/main/java/org/apache/maven/shared/transfer/project/deploy/ProjectDeployerRequest.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/deploy/ProjectDeployerRequest.java
@@ -1,132 +1,132 @@
-package org.apache.maven.shared.transfer.project.deploy;
-
-/*
- * 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.project.MavenProject;
-
-/**
- *
- * @author Robert Scholte
- */
-public class ProjectDeployerRequest
-{
-
- private int retryFailedDeploymentCount;
-
- // From DeployMojo
-
- private MavenProject project;
-
- private String altDeploymentRepository;
-
- private String altSnapshotDeploymentRepository;
-
- private String altReleaseDeploymentRepository;
-
- /**
- * @return the retryFailedDeploymentCount
- */
- public int getRetryFailedDeploymentCount()
- {
- return retryFailedDeploymentCount;
- }
-
- /**
- * @param theRetryFailedDeploymentCountToBeSet the retryFailedDeploymentCount to set
- * @return {@link ProjectDeployerRequest} for chaining.
- */
- public ProjectDeployerRequest setRetryFailedDeploymentCount( int theRetryFailedDeploymentCountToBeSet )
- {
- this.retryFailedDeploymentCount = theRetryFailedDeploymentCountToBeSet;
- return this;
- }
-
- /**
- * @return the project
- */
- public MavenProject getProject()
- {
- return project;
- }
-
- /**
- * @param theProjectToBeSet the {link {@link MavenProject project} to set
- * @return {@link ProjectDeployerRequest} for chaining.
- */
- public ProjectDeployerRequest setProject( MavenProject theProjectToBeSet )
- {
- this.project = theProjectToBeSet;
- return this;
- }
-
- /**
- * @return the altDeploymentRepository
- */
- public String getAltDeploymentRepository()
- {
- return altDeploymentRepository;
- }
-
- /**
- * @param theAltDeploymentRepositoryToBeSet the altDeploymentRepository to set
- * @return {@link ProjectDeployerRequest} for chaining.
- */
- public ProjectDeployerRequest setAltDeploymentRepository( String theAltDeploymentRepositoryToBeSet )
- {
- this.altDeploymentRepository = theAltDeploymentRepositoryToBeSet;
- return this;
- }
-
- /**
- * @return the altSnapshotDeploymentRepository
- */
- public String getAltSnapshotDeploymentRepository()
- {
- return altSnapshotDeploymentRepository;
- }
-
- /**
- * @param theAltSnapshotDeploymentRepositoryToBeSet the altSnapshotDeploymentRepository to set
- * @return {@link ProjectDeployerRequest} for chaining.
- */
- public ProjectDeployerRequest setAltSnapshotDeploymentRepository( String theAltSnapshotDeploymentRepositoryToBeSet )
- {
- this.altSnapshotDeploymentRepository = theAltSnapshotDeploymentRepositoryToBeSet;
- return this;
- }
-
- /**
- * @return the altReleaseDeploymentRepository
- */
- public String getAltReleaseDeploymentRepository()
- {
- return altReleaseDeploymentRepository;
- }
-
- /**
- * @param theAltReleaseDeploymentRepositoryToBeSet the altReleaseDeploymentRepository to set
- * @return {@link ProjectDeployerRequest} for chaining.
- */
- public ProjectDeployerRequest setAltReleaseDeploymentRepository( String theAltReleaseDeploymentRepositoryToBeSet )
- {
- this.altReleaseDeploymentRepository = theAltReleaseDeploymentRepositoryToBeSet;
- return this;
- }
-}
+package org.apache.maven.shared.transfer.project.deploy;
+
+/*
+ * 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.project.MavenProject;
+
+/**
+ *
+ * @author Robert Scholte
+ */
+public class ProjectDeployerRequest
+{
+
+ private int retryFailedDeploymentCount;
+
+ // From DeployMojo
+
+ private MavenProject project;
+
+ private String altDeploymentRepository;
+
+ private String altSnapshotDeploymentRepository;
+
+ private String altReleaseDeploymentRepository;
+
+ /**
+ * @return the retryFailedDeploymentCount
+ */
+ public int getRetryFailedDeploymentCount()
+ {
+ return retryFailedDeploymentCount;
+ }
+
+ /**
+ * @param theRetryFailedDeploymentCountToBeSet the retryFailedDeploymentCount to set
+ * @return {@link ProjectDeployerRequest} for chaining.
+ */
+ public ProjectDeployerRequest setRetryFailedDeploymentCount( int theRetryFailedDeploymentCountToBeSet )
+ {
+ this.retryFailedDeploymentCount = theRetryFailedDeploymentCountToBeSet;
+ return this;
+ }
+
+ /**
+ * @return the project
+ */
+ public MavenProject getProject()
+ {
+ return project;
+ }
+
+ /**
+ * @param theProjectToBeSet the {link {@link MavenProject project} to set
+ * @return {@link ProjectDeployerRequest} for chaining.
+ */
+ public ProjectDeployerRequest setProject( MavenProject theProjectToBeSet )
+ {
+ this.project = theProjectToBeSet;
+ return this;
+ }
+
+ /**
+ * @return the altDeploymentRepository
+ */
+ public String getAltDeploymentRepository()
+ {
+ return altDeploymentRepository;
+ }
+
+ /**
+ * @param theAltDeploymentRepositoryToBeSet the altDeploymentRepository to set
+ * @return {@link ProjectDeployerRequest} for chaining.
+ */
+ public ProjectDeployerRequest setAltDeploymentRepository( String theAltDeploymentRepositoryToBeSet )
+ {
+ this.altDeploymentRepository = theAltDeploymentRepositoryToBeSet;
+ return this;
+ }
+
+ /**
+ * @return the altSnapshotDeploymentRepository
+ */
+ public String getAltSnapshotDeploymentRepository()
+ {
+ return altSnapshotDeploymentRepository;
+ }
+
+ /**
+ * @param theAltSnapshotDeploymentRepositoryToBeSet the altSnapshotDeploymentRepository to set
+ * @return {@link ProjectDeployerRequest} for chaining.
+ */
+ public ProjectDeployerRequest setAltSnapshotDeploymentRepository( String theAltSnapshotDeploymentRepositoryToBeSet )
+ {
+ this.altSnapshotDeploymentRepository = theAltSnapshotDeploymentRepositoryToBeSet;
+ return this;
+ }
+
+ /**
+ * @return the altReleaseDeploymentRepository
+ */
+ public String getAltReleaseDeploymentRepository()
+ {
+ return altReleaseDeploymentRepository;
+ }
+
+ /**
+ * @param theAltReleaseDeploymentRepositoryToBeSet the altReleaseDeploymentRepository to set
+ * @return {@link ProjectDeployerRequest} for chaining.
+ */
+ public ProjectDeployerRequest setAltReleaseDeploymentRepository( String theAltReleaseDeploymentRepositoryToBeSet )
+ {
+ this.altReleaseDeploymentRepository = theAltReleaseDeploymentRepositoryToBeSet;
+ return this;
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/project/deploy/internal/DefaultProjectDeployer.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/deploy/internal/DefaultProjectDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/project/deploy/internal/DefaultProjectDeployer.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/deploy/internal/DefaultProjectDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/project/install/ProjectInstaller.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/install/ProjectInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/project/install/ProjectInstaller.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/install/ProjectInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/project/install/ProjectInstallerRequest.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/install/ProjectInstallerRequest.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/project/install/ProjectInstallerRequest.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/install/ProjectInstallerRequest.java
index 1cc4b9e..07cc6cd 100644
--- a/src/main/java/org/apache/maven/shared/transfer/project/install/ProjectInstallerRequest.java
+++ b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/install/ProjectInstallerRequest.java
@@ -1,51 +1,51 @@
-package org.apache.maven.shared.transfer.project.install;
-
-/*
- * 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.project.MavenProject;
-
-/**
- * @author Robert Scholte
- */
-public class ProjectInstallerRequest
-{
- // From InstallMojo
-
- private MavenProject project;
-
- /**
- * @return the project
- */
- public MavenProject getProject()
- {
- return project;
- }
-
- /**
- * @param theProjectToBeSet the project to set
- * @return {@link ProjectInstallerRequest} for chaining.
- */
- public ProjectInstallerRequest setProject( MavenProject theProjectToBeSet )
- {
- this.project = theProjectToBeSet;
- return this;
- }
-
-}
+package org.apache.maven.shared.transfer.project.install;
+
+/*
+ * 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.project.MavenProject;
+
+/**
+ * @author Robert Scholte
+ */
+public class ProjectInstallerRequest
+{
+ // From InstallMojo
+
+ private MavenProject project;
+
+ /**
+ * @return the project
+ */
+ public MavenProject getProject()
+ {
+ return project;
+ }
+
+ /**
+ * @param theProjectToBeSet the project to set
+ * @return {@link ProjectInstallerRequest} for chaining.
+ */
+ public ProjectInstallerRequest setProject( MavenProject theProjectToBeSet )
+ {
+ this.project = theProjectToBeSet;
+ return this;
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/project/install/internal/DefaultProjectInstaller.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/install/internal/DefaultProjectInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/project/install/internal/DefaultProjectInstaller.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/project/install/internal/DefaultProjectInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/repository/RepositoryManager.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/RepositoryManager.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/repository/RepositoryManager.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/RepositoryManager.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/repository/RepositoryManagerException.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/RepositoryManagerException.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/repository/RepositoryManagerException.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/RepositoryManagerException.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/repository/internal/DefaultRepositoryManager.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/DefaultRepositoryManager.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/repository/internal/DefaultRepositoryManager.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/DefaultRepositoryManager.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/repository/internal/Invoker.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/Invoker.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/repository/internal/Invoker.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/Invoker.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven302RepositoryManager.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven302RepositoryManager.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven302RepositoryManager.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven302RepositoryManager.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven30RepositoryManager.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven30RepositoryManager.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven30RepositoryManager.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven30RepositoryManager.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven31RepositoryManager.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven31RepositoryManager.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven31RepositoryManager.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven31RepositoryManager.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/repository/internal/MavenRepositoryManager.java b/maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/MavenRepositoryManager.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/repository/internal/MavenRepositoryManager.java
copy to maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/MavenRepositoryManager.java
diff --git a/src/test/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinateTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinateTest.java
similarity index 97%
copy from src/test/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinateTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinateTest.java
index 155cfc2..5e3923d 100644
--- a/src/test/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinateTest.java
+++ b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinateTest.java
@@ -1,50 +1,50 @@
-package org.apache.maven.shared.transfer.artifact;
-
-/*
- * 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 static org.junit.Assert.*;
-
-import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate;
-import org.junit.Test;
-
-public class DefaultArtifactCoordinateTest
-{
- @Test
- public void testToStringWithoutType()
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
- coordinate.setGroupId( "GROUPID" );
- coordinate.setArtifactId( "ARTIFACTID" );
- coordinate.setVersion( "VERSION" );
- assertEquals( "GROUPID:ARTIFACTID:jar:VERSION", coordinate.toString() );
- }
-
- @Test
- public void testToStringWithClassifier()
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
- coordinate.setGroupId( "GROUPID" );
- coordinate.setArtifactId( "ARTIFACTID" );
- coordinate.setVersion( "VERSION" );
- coordinate.setClassifier( "CLASSIFIER" );
- coordinate.setExtension( "EXTENSION" );
- assertEquals( "GROUPID:ARTIFACTID:EXTENSION:CLASSIFIER:VERSION", coordinate.toString() );
- }
-}
+package org.apache.maven.shared.transfer.artifact;
+
+/*
+ * 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 static org.junit.Assert.*;
+
+import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate;
+import org.junit.Test;
+
+public class DefaultArtifactCoordinateTest
+{
+ @Test
+ public void testToStringWithoutType()
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+ coordinate.setGroupId( "GROUPID" );
+ coordinate.setArtifactId( "ARTIFACTID" );
+ coordinate.setVersion( "VERSION" );
+ assertEquals( "GROUPID:ARTIFACTID:jar:VERSION", coordinate.toString() );
+ }
+
+ @Test
+ public void testToStringWithClassifier()
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+ coordinate.setGroupId( "GROUPID" );
+ coordinate.setArtifactId( "ARTIFACTID" );
+ coordinate.setVersion( "VERSION" );
+ coordinate.setClassifier( "CLASSIFIER" );
+ coordinate.setExtension( "EXTENSION" );
+ assertEquals( "GROUPID:ARTIFACTID:EXTENSION:CLASSIFIER:VERSION", coordinate.toString() );
+ }
+}
diff --git a/src/test/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployerTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployerTest.java
similarity index 100%
copy from src/test/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployerTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployerTest.java
diff --git a/src/test/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstallerTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstallerTest.java
similarity index 100%
copy from src/test/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstallerTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstallerTest.java
diff --git a/src/test/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstallerTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstallerTest.java
similarity index 100%
copy from src/test/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstallerTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstallerTest.java
diff --git a/src/test/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolverTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolverTest.java
similarity index 100%
copy from src/test/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolverTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolverTest.java
diff --git a/src/test/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollectorTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollectorTest.java
similarity index 100%
copy from src/test/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollectorTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollectorTest.java
diff --git a/src/test/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinateTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinateTest.java
similarity index 97%
copy from src/test/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinateTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinateTest.java
index 6172247..4678b46 100644
--- a/src/test/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinateTest.java
+++ b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/dependencies/DefaultDependableCoordinateTest.java
@@ -1,52 +1,52 @@
-package org.apache.maven.shared.transfer.dependencies;
-
-/*
- * 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 static org.junit.Assert.assertEquals;
-
-import org.apache.maven.shared.transfer.dependencies.DefaultDependableCoordinate;
-import org.junit.Test;
-
-public class DefaultDependableCoordinateTest
-{
-
- @Test
- public void testToStringWithoutType()
- {
- DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
- coordinate.setGroupId( "GROUPID" );
- coordinate.setArtifactId( "ARTIFACTID" );
- coordinate.setVersion( "VERSION" );
- assertEquals( "GROUPID:ARTIFACTID:jar:VERSION", coordinate.toString() );
- }
-
- @Test
- public void testToStringWithClassifier()
- {
- DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
- coordinate.setGroupId( "GROUPID" );
- coordinate.setArtifactId( "ARTIFACTID" );
- coordinate.setVersion( "VERSION" );
- coordinate.setClassifier( "CLASSIFIER" );
- coordinate.setType( "TYPE" );
- assertEquals( "GROUPID:ARTIFACTID:TYPE:CLASSIFIER:VERSION", coordinate.toString() );
- }
-
-}
+package org.apache.maven.shared.transfer.dependencies;
+
+/*
+ * 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 static org.junit.Assert.assertEquals;
+
+import org.apache.maven.shared.transfer.dependencies.DefaultDependableCoordinate;
+import org.junit.Test;
+
+public class DefaultDependableCoordinateTest
+{
+
+ @Test
+ public void testToStringWithoutType()
+ {
+ DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
+ coordinate.setGroupId( "GROUPID" );
+ coordinate.setArtifactId( "ARTIFACTID" );
+ coordinate.setVersion( "VERSION" );
+ assertEquals( "GROUPID:ARTIFACTID:jar:VERSION", coordinate.toString() );
+ }
+
+ @Test
+ public void testToStringWithClassifier()
+ {
+ DefaultDependableCoordinate coordinate = new DefaultDependableCoordinate();
+ coordinate.setGroupId( "GROUPID" );
+ coordinate.setArtifactId( "ARTIFACTID" );
+ coordinate.setVersion( "VERSION" );
+ coordinate.setClassifier( "CLASSIFIER" );
+ coordinate.setType( "TYPE" );
+ assertEquals( "GROUPID:ARTIFACTID:TYPE:CLASSIFIER:VERSION", coordinate.toString() );
+ }
+
+}
diff --git a/src/test/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollectorTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollectorTest.java
similarity index 100%
copy from src/test/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollectorTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollectorTest.java
diff --git a/src/test/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolverTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolverTest.java
similarity index 100%
copy from src/test/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolverTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolverTest.java
diff --git a/src/test/java/org/apache/maven/shared/transfer/project/deploy/internal/DefaultProjectDeployerTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/project/deploy/internal/DefaultProjectDeployerTest.java
similarity index 100%
copy from src/test/java/org/apache/maven/shared/transfer/project/deploy/internal/DefaultProjectDeployerTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/project/deploy/internal/DefaultProjectDeployerTest.java
diff --git a/src/test/java/org/apache/maven/shared/transfer/project/install/internal/DefaultProjectInstallerTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/project/install/internal/DefaultProjectInstallerTest.java
similarity index 100%
copy from src/test/java/org/apache/maven/shared/transfer/project/install/internal/DefaultProjectInstallerTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/project/install/internal/DefaultProjectInstallerTest.java
diff --git a/src/test/java/org/apache/maven/shared/transfer/repository/internal/Maven30RepositoryManagerTest.java b/maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/repository/internal/Maven30RepositoryManagerTest.java
similarity index 100%
copy from src/test/java/org/apache/maven/shared/transfer/repository/internal/Maven30RepositoryManagerTest.java
copy to maven-3.0.x/src/test/java/org/apache/maven/shared/transfer/repository/internal/Maven30RepositoryManagerTest.java
diff --git a/maven-3.1.x/pom.xml b/maven-3.1.x/pom.xml
new file mode 100644
index 0000000..b5ec080
--- /dev/null
+++ b/maven-3.1.x/pom.xml
@@ -0,0 +1,140 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-artifact-transfer-parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>maven-artifact-transfer-maven-3.1.x</artifactId>
+
+ <name>Apache Maven Artifact Transfer Maven 3.1.x provider</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>3.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-annotations</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-common-artifact-filters</artifactId>
+ <version>3.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>3.3.0</version>
+ </dependency>
+
+ <!-- Maven 3.0.x -->
+ <dependency>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ <version>1.7</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-util</artifactId>
+ <version>1.7</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-impl</artifactId>
+ <version>1.7</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Maven 3.1.x and above -->
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ <version>0.9.0.M2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-util</artifactId>
+ <version>0.9.0.M2</version>
+ <!-- provided scoped dependencies aren't shaded -->
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-impl</artifactId>
+ <version>0.9.0.M2</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.5</version>
+ </dependency>
+
+ <!-- TEST -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.13.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>2.28.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.sisu</groupId>
+ <artifactId>sisu-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>animal-sniffer-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java
index eed2eca..7b0654b 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java
+++ b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/ArtifactCoordinate.java
@@ -1,60 +1,60 @@
-package org.apache.maven.shared.transfer.artifact;
-
-/*
- * 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.
- */
-
-/**
- * <p>
- * Contains all required elements of a Maven Artifact to resolve and calculate its path for either a local or
- * remote Maven2 repository.
- * </p>
- *
- * @author Robert Scholte
- */
-public interface ArtifactCoordinate
-{
- /**
- * @return The groupId of the artifact.
- */
- String getGroupId();
-
- /**
- * @return The artifactId of the artifact.
- */
- String getArtifactId();
-
- /**
- * A version, never a versionRange
- *
- * @return The version.
- */
- String getVersion();
-
- /**
- * The file-extension of the artifact.
- *
- * @return The extension.
- */
- String getExtension();
-
- /**
- * @return The classifier of the artifact.
- */
- String getClassifier();
+package org.apache.maven.shared.transfer.artifact;
+
+/*
+ * 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.
+ */
+
+/**
+ * <p>
+ * Contains all required elements of a Maven Artifact to resolve and calculate its path for either a local or
+ * remote Maven2 repository.
+ * </p>
+ *
+ * @author Robert Scholte
+ */
+public interface ArtifactCoordinate
+{
+ /**
+ * @return The groupId of the artifact.
+ */
+ String getGroupId();
+
+ /**
+ * @return The artifactId of the artifact.
+ */
+ String getArtifactId();
+
+ /**
+ * A version, never a versionRange
+ *
+ * @return The version.
+ */
+ String getVersion();
+
+ /**
+ * The file-extension of the artifact.
+ *
+ * @return The extension.
+ */
+ String getExtension();
+
+ /**
+ * @return The classifier of the artifact.
+ */
+ String getClassifier();
}
\ No newline at end of file
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java
similarity index 95%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java
index 070607d..9b86ee2 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java
+++ b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/DefaultArtifactCoordinate.java
@@ -1,184 +1,184 @@
-package org.apache.maven.shared.transfer.artifact;
-
-/*
- * 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.
- */
-
-/**
- * Common usage of an ArtifactCoordinate for a Mojo
- *
- * <pre>
- * @Parameter
- * private DefaultArtifactCoordinate[] artifacts;
- * </pre>
- *
- * and
- *
- * <pre>
- * private DefaultArtifactCoordinate artifact = new DefaultArtifactCoordinate();
- *
- * @Parameter( property = "groupId" )
- * private String groupId;
- *
- * @Parameter( property = "artifactId" )
- * private String artifactId;
- *
- * @Parameter( property = "version" )
- * private String version;
- *
- * @Parameter( property = "classifier" )
- * private String classifier;
- *
- * @Parameter( property = "type" )
- * private String type;
- *
- * public void setGroupId( String groupId )
- * {
- * this.artifact.setGroupId( groupId );
- * }
- *
- * public void setArtifactId( String artifactId )
- * {
- * this.artifact.setArtifactId( artifactId );
- * }
- *
- * public void setVersion( String version )
- * {
- * this.artifact.setVersion( version );
- * }
- *
- * public void setClassifier( String classifier )
- * {
- * this.artifact.setClassifier( classifier );
- * }
- *
- * public void setType( String type )
- * {
- * this.artifact.setType( type );
- * }
- * </pre>
- *
- * <strong>Note: </strong> type is not the same as extension! {@link org.apache.maven.artifact.handler.ArtifactHandler}s
- * are used to map a type to an extension.
- *
- * @author Robert Scholte
- * @since 3.0
- */
-public class DefaultArtifactCoordinate
- implements ArtifactCoordinate
-{
- private String groupId;
-
- private String artifactId;
-
- private String version;
-
- private String extension;
-
- private String classifier;
-
- @Override
- public final String getGroupId()
- {
- return groupId;
- }
-
- /**
- * @param groupId The groupId to be used.
- */
- public final void setGroupId( String groupId )
- {
- this.groupId = groupId;
- }
-
- @Override
- public final String getArtifactId()
- {
- return artifactId;
- }
-
- /**
- * @param artifactId The artifactId to be used.
- */
- public final void setArtifactId( String artifactId )
- {
- this.artifactId = artifactId;
- }
-
- @Override
- public final String getVersion()
- {
- return version;
- }
-
- /**
- * @param version The version to be used.
- */
- public final void setVersion( String version )
- {
- this.version = version;
- }
-
- @Override
- public final String getExtension()
- {
- return extension != null ? extension : "jar";
- }
-
- /**
- * @param extension The extension to be used.
- */
- public final void setExtension( String extension )
- {
- this.extension = extension;
- }
-
- @Override
- public final String getClassifier()
- {
- return classifier;
- }
-
- /**
- * @param classifier The classifier to be used.
- */
- public final void setClassifier( String classifier )
- {
- this.classifier = classifier;
- }
-
- /**
- * @see org.apache.maven.artifact.DefaultArtifact#toString()
- */
- @Override
- public String toString()
- {
- StringBuilder sb = new StringBuilder().append( groupId ).append( ':' )
- .append( artifactId ).append( ':' ).append( getExtension() );
-
- if ( classifier != null )
- {
- sb.append( ':' ).append( classifier );
- }
-
- sb.append( ':' ).append( version );
-
- return sb.toString();
- }
-
-}
+package org.apache.maven.shared.transfer.artifact;
+
+/*
+ * 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.
+ */
+
+/**
+ * Common usage of an ArtifactCoordinate for a Mojo
+ *
+ * <pre>
+ * @Parameter
+ * private DefaultArtifactCoordinate[] artifacts;
+ * </pre>
+ *
+ * and
+ *
+ * <pre>
+ * private DefaultArtifactCoordinate artifact = new DefaultArtifactCoordinate();
+ *
+ * @Parameter( property = "groupId" )
+ * private String groupId;
+ *
+ * @Parameter( property = "artifactId" )
+ * private String artifactId;
+ *
+ * @Parameter( property = "version" )
+ * private String version;
+ *
+ * @Parameter( property = "classifier" )
+ * private String classifier;
+ *
+ * @Parameter( property = "type" )
+ * private String type;
+ *
+ * public void setGroupId( String groupId )
+ * {
+ * this.artifact.setGroupId( groupId );
+ * }
+ *
+ * public void setArtifactId( String artifactId )
+ * {
+ * this.artifact.setArtifactId( artifactId );
+ * }
+ *
+ * public void setVersion( String version )
+ * {
+ * this.artifact.setVersion( version );
+ * }
+ *
+ * public void setClassifier( String classifier )
+ * {
+ * this.artifact.setClassifier( classifier );
+ * }
+ *
+ * public void setType( String type )
+ * {
+ * this.artifact.setType( type );
+ * }
+ * </pre>
+ *
+ * <strong>Note: </strong> type is not the same as extension! {@link org.apache.maven.artifact.handler.ArtifactHandler}s
+ * are used to map a type to an extension.
+ *
+ * @author Robert Scholte
+ * @since 3.0
+ */
+public class DefaultArtifactCoordinate
+ implements ArtifactCoordinate
+{
+ private String groupId;
+
+ private String artifactId;
+
+ private String version;
+
+ private String extension;
+
+ private String classifier;
+
+ @Override
+ public final String getGroupId()
+ {
+ return groupId;
+ }
+
+ /**
+ * @param groupId The groupId to be used.
+ */
+ public final void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
+
+ @Override
+ public final String getArtifactId()
+ {
+ return artifactId;
+ }
+
+ /**
+ * @param artifactId The artifactId to be used.
+ */
+ public final void setArtifactId( String artifactId )
+ {
+ this.artifactId = artifactId;
+ }
+
+ @Override
+ public final String getVersion()
+ {
+ return version;
+ }
+
+ /**
+ * @param version The version to be used.
+ */
+ public final void setVersion( String version )
+ {
+ this.version = version;
+ }
+
+ @Override
+ public final String getExtension()
+ {
+ return extension != null ? extension : "jar";
+ }
+
+ /**
+ * @param extension The extension to be used.
+ */
+ public final void setExtension( String extension )
+ {
+ this.extension = extension;
+ }
+
+ @Override
+ public final String getClassifier()
+ {
+ return classifier;
+ }
+
+ /**
+ * @param classifier The classifier to be used.
+ */
+ public final void setClassifier( String classifier )
+ {
+ this.classifier = classifier;
+ }
+
+ /**
+ * @see org.apache.maven.artifact.DefaultArtifact#toString()
+ */
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder().append( groupId ).append( ':' )
+ .append( artifactId ).append( ':' ).append( getExtension() );
+
+ if ( classifier != null )
+ {
+ sb.append( ':' ).append( classifier );
+ }
+
+ sb.append( ':' ).append( version );
+
+ return sb.toString();
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java
index 83fa7e1..d4506c3 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java
+++ b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/TransferUtils.java
@@ -1,125 +1,125 @@
-package org.apache.maven.shared.transfer.artifact;
-
-/*
- * 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.Artifact;
-import org.apache.maven.model.Extension;
-import org.apache.maven.model.Parent;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.ReportPlugin;
-
-/**
- * Utility class
- *
- * @author Robert Scholte
- */
-public final class TransferUtils
-{
- private TransferUtils()
- {
- }
-
- /**
- * @param artifact {@link Artifact}
- * @return {@link ArtifactCoordinate}
- */
- public static ArtifactCoordinate toArtifactCoordinate( Artifact artifact )
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
-
- coordinate.setGroupId( artifact.getGroupId() );
- coordinate.setArtifactId( artifact.getArtifactId() );
- coordinate.setVersion( artifact.getVersion() );
- coordinate.setExtension( artifact.getArtifactHandler().getExtension() );
- coordinate.setClassifier( artifact.getClassifier() );
-
- return coordinate;
- }
-
- /**
- * Special case: an extension is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
- *
- * @param extension {@link Extension}
- * @return {@link ArtifactCoordinate}
- */
- public static ArtifactCoordinate toArtifactCoordinate( Extension extension )
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
-
- coordinate.setGroupId( extension.getGroupId() );
- coordinate.setArtifactId( extension.getArtifactId() );
- coordinate.setVersion( extension.getVersion() );
-
- return coordinate;
- }
-
- /**
- * Special case: a parent is always of type {@code pom}, so can be transformed to an ArtifactCoordinate.
- *
- * @param parent {@link Parent}
- * @return {@link ArtifactCoordinate}
- */
- public static ArtifactCoordinate toArtifactCoordinate( Parent parent )
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
-
- coordinate.setGroupId( parent.getGroupId() );
- coordinate.setArtifactId( parent.getArtifactId() );
- coordinate.setVersion( parent.getVersion() );
- coordinate.setExtension( "pom" );
-
- return coordinate;
- }
-
- /**
- * Special case: a plugin is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
- *
- * @param plugin {@link Plugin}
- * @return {@link ArtifactCoordinate}
- */
- public static ArtifactCoordinate toArtifactCoordinate( Plugin plugin )
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
-
- coordinate.setGroupId( plugin.getGroupId() );
- coordinate.setArtifactId( plugin.getArtifactId() );
- coordinate.setVersion( plugin.getVersion() );
-
- return coordinate;
- }
-
- /**
- * Special case: a reportPlugin is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
- *
- * @param plugin {@link ReportPlugin}
- * @return {@link ArtifactCoordinate}
- */
- public static ArtifactCoordinate toArtifactCoordinate( ReportPlugin plugin )
- {
- DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
-
- coordinate.setGroupId( plugin.getGroupId() );
- coordinate.setArtifactId( plugin.getArtifactId() );
- coordinate.setVersion( plugin.getVersion() );
-
- return coordinate;
- }
-
-}
+package org.apache.maven.shared.transfer.artifact;
+
+/*
+ * 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.Artifact;
+import org.apache.maven.model.Extension;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.ReportPlugin;
+
+/**
+ * Utility class
+ *
+ * @author Robert Scholte
+ */
+public final class TransferUtils
+{
+ private TransferUtils()
+ {
+ }
+
+ /**
+ * @param artifact {@link Artifact}
+ * @return {@link ArtifactCoordinate}
+ */
+ public static ArtifactCoordinate toArtifactCoordinate( Artifact artifact )
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+
+ coordinate.setGroupId( artifact.getGroupId() );
+ coordinate.setArtifactId( artifact.getArtifactId() );
+ coordinate.setVersion( artifact.getVersion() );
+ coordinate.setExtension( artifact.getArtifactHandler().getExtension() );
+ coordinate.setClassifier( artifact.getClassifier() );
+
+ return coordinate;
+ }
+
+ /**
+ * Special case: an extension is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
+ *
+ * @param extension {@link Extension}
+ * @return {@link ArtifactCoordinate}
+ */
+ public static ArtifactCoordinate toArtifactCoordinate( Extension extension )
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+
+ coordinate.setGroupId( extension.getGroupId() );
+ coordinate.setArtifactId( extension.getArtifactId() );
+ coordinate.setVersion( extension.getVersion() );
+
+ return coordinate;
+ }
+
+ /**
+ * Special case: a parent is always of type {@code pom}, so can be transformed to an ArtifactCoordinate.
+ *
+ * @param parent {@link Parent}
+ * @return {@link ArtifactCoordinate}
+ */
+ public static ArtifactCoordinate toArtifactCoordinate( Parent parent )
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+
+ coordinate.setGroupId( parent.getGroupId() );
+ coordinate.setArtifactId( parent.getArtifactId() );
+ coordinate.setVersion( parent.getVersion() );
+ coordinate.setExtension( "pom" );
+
+ return coordinate;
+ }
+
+ /**
+ * Special case: a plugin is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
+ *
+ * @param plugin {@link Plugin}
+ * @return {@link ArtifactCoordinate}
+ */
+ public static ArtifactCoordinate toArtifactCoordinate( Plugin plugin )
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+
+ coordinate.setGroupId( plugin.getGroupId() );
+ coordinate.setArtifactId( plugin.getArtifactId() );
+ coordinate.setVersion( plugin.getVersion() );
+
+ return coordinate;
+ }
+
+ /**
+ * Special case: a reportPlugin is always of type {@code jar}, so can be transformed to an ArtifactCoordinate.
+ *
+ * @param plugin {@link ReportPlugin}
+ * @return {@link ArtifactCoordinate}
+ */
+ public static ArtifactCoordinate toArtifactCoordinate( ReportPlugin plugin )
+ {
+ DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
+
+ coordinate.setGroupId( plugin.getGroupId() );
+ coordinate.setArtifactId( plugin.getArtifactId() );
+ coordinate.setVersion( plugin.getVersion() );
+
+ return coordinate;
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployer.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployer.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployerException.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployerException.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployerException.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/ArtifactDeployerException.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Invoker.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Invoker.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Invoker.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Invoker.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven30ArtifactDeployer.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven30ArtifactDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven30ArtifactDeployer.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven30ArtifactDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven31ArtifactDeployer.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven31ArtifactDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven31ArtifactDeployer.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/Maven31ArtifactDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/MavenArtifactDeployer.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/MavenArtifactDeployer.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/MavenArtifactDeployer.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/MavenArtifactDeployer.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstaller.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstaller.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstallerException.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstallerException.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstallerException.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/ArtifactInstallerException.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Invoker.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Invoker.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Invoker.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Invoker.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstaller.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstaller.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven30ArtifactInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven31ArtifactInstaller.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven31ArtifactInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven31ArtifactInstaller.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/Maven31ArtifactInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/MavenArtifactInstaller.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/MavenArtifactInstaller.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/MavenArtifactInstaller.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/MavenArtifactInstaller.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolver.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolverException.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolverException.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolverException.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolverException.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java
similarity index 96%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java
index bc89ff0..6941975 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java
+++ b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/ArtifactResult.java
@@ -1,36 +1,36 @@
-package org.apache.maven.shared.transfer.artifact.resolve;
-
-/*
- * 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.Artifact;
-
-/**
- * The Artifact Result
- *
- * @author Robert Scholte
- * @since 3.0
- */
-public interface ArtifactResult
-{
- /**
- * @return {@link Artifact}
- */
- Artifact getArtifact();
-}
+package org.apache.maven.shared.transfer.artifact.resolve;
+
+/*
+ * 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.Artifact;
+
+/**
+ * The Artifact Result
+ *
+ * @author Robert Scholte
+ * @since 3.0
+ */
+public interface ArtifactResult
+{
+ /**
+ * @return {@link Artifact}
+ */
+ Artifact getArtifact();
+}
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Invoker.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Invoker.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Invoker.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Invoker.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java
similarity index 100%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResolver.java
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java
similarity index 97%
copy from src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java
copy to maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java
index 3bbea28..e65c00b 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java
+++ b/maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/Maven30ArtifactResult.java
@@ -1,57 +1,57 @@
-package org.apache.maven.shared.transfer.artifact.resolve.internal;
-
-/*
- * 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.RepositoryUtils;
-import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
-import org.sonatype.aether.artifact.Artifact;
-import org.sonatype.aether.resolution.ArtifactResult;
-
-/**
- * {@link org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult} wrapper for {@link ArtifactResult}
- *
- * @author Robert Scholte
- * @since 3.0
- */
-class Maven30ArtifactResult implements org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult
-{
- private final ArtifactResult artifactResult;
-
- /**
- * @param artifactResult {@link ArtifactResult}
- */
- Maven30ArtifactResult( ArtifactResult artifactResult )
- {
- this.artifactResult = artifactResult;
- }
-
- @Override
- public org.apache.maven.artifact.Artifact getArtifact()
- {
- try
- {
- return Invoker.invoke( RepositoryUtils.class, "toArtifact", Artifact.class, artifactResult.getArtifact() );
- }
- catch ( ArtifactResolverException e )
- {
- throw new RuntimeException( e );
- }
- }
-}
+package org.apache.maven.shared.transfer.artifact.resolve.internal;
+
+/*
+ * 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.RepositoryUtils;
+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
+import org.sonatype.aether.artifact.Artifact;
+import org.sonatype.aether.resolution.ArtifactResult;
+
+/**
+ * {@link org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult} wrapper for {@link ArtifactResult}
+ *
+ * @author Robert Scholte
+ * @since 3.0
+ */
+class Maven30ArtifactResult implements org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult
+{
+ private final ArtifactResult artifactResult;
+
+ /**
+ * @param artifactResult {@link ArtifactResult}
+ */
+ Maven30ArtifactResult( ArtifactResult artifactResult )
+ {
+ this.artifactResult = artifactResult;
+ }
+
+ @Override
... 24163 lines suppressed ...