maven-artifact-transfer/0002-Remove-support-for-maven-3.0.X.patch

177 lines
9.6 KiB
Diff

From 21bf966408cf1bceaa6603e45958bc30ddae8c83 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Thu, 14 Jan 2021 18:21:21 +0100
Subject: [PATCH] Remove support for maven 3.0.X
---
.../deploy/internal/DefaultArtifactDeployer.java | 8 +-------
.../internal/DefaultArtifactInstaller.java | 8 +-------
.../internal/DefaultArtifactResolver.java | 11 +----------
.../internal/DefaultDependencyCollector.java | 12 +-----------
.../internal/DefaultDependencyCollector.java | 13 +------------
.../internal/DefaultDependencyResolver.java | 13 +------------
.../internal/DefaultRepositoryManager.java | 16 +---------------
7 files changed, 7 insertions(+), 74 deletions(-)
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java b/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java
index 11a268c..9b24335 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java
+++ b/src/main/java/org/apache/maven/shared/transfer/artifact/deploy/internal/DefaultArtifactDeployer.java
@@ -133,13 +133,7 @@ class DefaultArtifactDeployer implements ArtifactDeployer, Contextualizable
}
else
{
- org.sonatype.aether.RepositorySystem repositorySystem = container.lookup(
- org.sonatype.aether.RepositorySystem.class );
-
- org.sonatype.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
- "getRepositorySession" );
-
- return new Maven30ArtifactDeployer( repositorySystem, session );
+ throw new UnsupportedOperationException("Maven 3.0.X is not supported");
}
}
}
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java b/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java
index 238e814..000bdbb 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java
+++ b/src/main/java/org/apache/maven/shared/transfer/artifact/install/internal/DefaultArtifactInstaller.java
@@ -150,13 +150,7 @@ class DefaultArtifactInstaller implements ArtifactInstaller, Contextualizable
}
else
{
- org.sonatype.aether.RepositorySystem repositorySystem = container.lookup(
- org.sonatype.aether.RepositorySystem.class );
-
- org.sonatype.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
- "getRepositorySession" );
-
- return new Maven30ArtifactInstaller( repositorySystem, session );
+ throw new UnsupportedOperationException("Maven 3.0.X is not supported");
}
}
}
diff --git a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java b/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
index 83d7517..cfb5b61 100644
--- a/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
+++ b/src/main/java/org/apache/maven/shared/transfer/artifact/resolve/internal/DefaultArtifactResolver.java
@@ -146,16 +146,7 @@ class DefaultArtifactResolver implements ArtifactResolver, Contextualizable
}
else
{
- org.sonatype.aether.RepositorySystem repositorySystem = container.lookup(
- org.sonatype.aether.RepositorySystem.class );
-
- List<org.sonatype.aether.repository.RemoteRepository> aetherRepositories = Invoker.invoke(
- RepositoryUtils.class, "toRepos", List.class, buildingRequest.getRemoteRepositories() );
-
- org.sonatype.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
- "getRepositorySession" );
-
- return new Maven30ArtifactResolver( repositorySystem, aetherRepositories, session );
+ throw new UnsupportedOperationException("Maven 3.0.X is not supported");
}
diff --git a/src/main/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollector.java b/src/main/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollector.java
index e6ce50e..bfb7797 100644
--- a/src/main/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollector.java
+++ b/src/main/java/org/apache/maven/shared/transfer/collection/internal/DefaultDependencyCollector.java
@@ -177,17 +177,7 @@ class DefaultDependencyCollector implements DependencyCollector, Contextualizabl
}
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 );
+ throw new UnsupportedOperationException("Maven 3.0.X is not supported");
}
}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollector.java b/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollector.java
index bf84fc9..c906534 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollector.java
+++ b/src/main/java/org/apache/maven/shared/transfer/dependencies/collect/internal/DefaultDependencyCollector.java
@@ -179,18 +179,7 @@ class DefaultDependencyCollector implements DependencyCollector, Contextualizabl
}
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 );
+ throw new UnsupportedOperationException("Maven 3.0.X is not supported");
}
}
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java b/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java
index 28289a8..34779d2 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java
+++ b/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java
@@ -164,18 +164,7 @@ class DefaultDependencyResolver implements DependencyResolver, Contextualizable
}
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 );
-
+ throw new UnsupportedOperationException("Maven 3.0.X is not supported");
}
}
diff --git a/src/main/java/org/apache/maven/shared/transfer/repository/internal/DefaultRepositoryManager.java b/src/main/java/org/apache/maven/shared/transfer/repository/internal/DefaultRepositoryManager.java
index c29cc08..add22fa 100644
--- a/src/main/java/org/apache/maven/shared/transfer/repository/internal/DefaultRepositoryManager.java
+++ b/src/main/java/org/apache/maven/shared/transfer/repository/internal/DefaultRepositoryManager.java
@@ -166,21 +166,7 @@ class DefaultRepositoryManager
}
else
{
- org.sonatype.aether.RepositorySystem m30RepositorySystem =
- container.lookup( org.sonatype.aether.RepositorySystem.class );
-
- org.sonatype.aether.RepositorySystemSession session = Invoker.invoke( buildingRequest,
- "getRepositorySession" );
-
- if ( isMaven302() )
- {
- return new Maven302RepositoryManager( m30RepositorySystem, session );
-
- }
- else
- {
- return new Maven30RepositoryManager( m30RepositorySystem, session );
- }
+ throw new UnsupportedOperationException("Maven 3.0.X is not supported");
}
}
--
2.29.2