From 5ac3a39725ab142bf770a9cc2943fadd5e774b32 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Sun, 17 Apr 2022 00:06:24 +0200 Subject: [PATCH] Switch to org.eclipse --- .../javadoc/AggregatorJavadocReportTest.java | 5 +++- .../plugins/javadoc/JavadocReportTest.java | 27 ++++++++++--------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java b/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java index ae7e0736b..338bdc23b 100644 --- a/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java +++ b/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java @@ -34,6 +34,9 @@ import org.apache.maven.project.MavenProject; import org.codehaus.plexus.languages.java.version.JavaVersion; import org.codehaus.plexus.util.FileUtils; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.repository.LocalRepository; public class AggregatorJavadocReportTest extends AbstractMojoTestCase @@ -75,7 +78,7 @@ private JavadocReport lookupMojo( File testPom ) MavenSession session = newMavenSession( currentProject ); DefaultRepositorySystemSession repoSysSession = (DefaultRepositorySystemSession) session.getRepositorySession(); - repoSysSession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepo ) ); + repoSysSession.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( repoSysSession, new LocalRepository( localRepo ) ) ); setVariableValueToObject( mojo, "session", session ); return mojo; diff --git a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java index e44d3b744..3eac8534b 100644 --- a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java +++ b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java @@ -59,6 +59,9 @@ import org.apache.maven.shared.utils.StringUtils; import org.apache.maven.shared.utils.io.FileUtils; import org.codehaus.plexus.languages.java.version.JavaVersion; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.repository.LocalRepository; import org.hamcrest.MatcherAssert; import org.junit.AssumptionViolatedException; import org.slf4j.Logger; @@ -503,8 +506,8 @@ public void testDoclets() ProjectBuildingRequest buildingRequest = mock( ProjectBuildingRequest.class ); when( buildingRequest.getRemoteRepositories() ).thenReturn( mojo.project.getRemoteArtifactRepositories() ); when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest ); - MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession(); - repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepo ) ); + DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession(); + repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( repositorySession, new LocalRepository( localRepo ) ) ); when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession ); when( session.getRepositorySession() ).thenReturn( repositorySession ); LegacySupport legacySupport = lookup( LegacySupport.class ); @@ -685,8 +688,8 @@ public void testTaglets() ProjectBuildingRequest buildingRequest = mock( ProjectBuildingRequest.class ); when( buildingRequest.getRemoteRepositories() ).thenReturn( mojo.project.getRemoteArtifactRepositories() ); when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest ); - MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession(); - repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepo ) ); + DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession(); + repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( repositorySession, new LocalRepository( localRepo ) ) ); when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession ); when( session.getRepositorySession() ).thenReturn( repositorySession ); LegacySupport legacySupport = lookup( LegacySupport.class ); @@ -980,8 +983,8 @@ public void testProxy() ProjectBuildingRequest buildingRequest = mock( ProjectBuildingRequest.class ); when( buildingRequest.getRemoteRepositories() ).thenReturn( mojo.project.getRemoteArtifactRepositories() ); when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest ); - MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession(); - repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepo ) ); + DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession(); + repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( repositorySession, new LocalRepository( localRepo ) ) ); when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession ); when( session.getRepositorySession() ).thenReturn( repositorySession ); LegacySupport legacySupport = lookup( LegacySupport.class ); @@ -1192,8 +1195,8 @@ public void testTagletArtifacts() ProjectBuildingRequest buildingRequest = mock( ProjectBuildingRequest.class ); when( buildingRequest.getRemoteRepositories() ).thenReturn( mojo.project.getRemoteArtifactRepositories() ); when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest ); - MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession(); - repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepo ) ); + DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession(); + repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( repositorySession, new LocalRepository( localRepo ) ) ); when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession ); when( session.getRepositorySession() ).thenReturn( repositorySession ); LegacySupport legacySupport = lookup( LegacySupport.class ); @@ -1246,8 +1249,8 @@ public void testStylesheetfile() ProjectBuildingRequest buildingRequest = mock( ProjectBuildingRequest.class ); when( buildingRequest.getRemoteRepositories() ).thenReturn( mojo.project.getRemoteArtifactRepositories() ); when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest ); - MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession(); - repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepo ) ); + DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession(); + repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( repositorySession, new LocalRepository( localRepo ) ) ); when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession ); when( session.getRepositorySession() ).thenReturn( repositorySession ); LegacySupport legacySupport = lookup( LegacySupport.class ); @@ -1368,8 +1371,8 @@ public void testHelpfile() ProjectBuildingRequest buildingRequest = mock( ProjectBuildingRequest.class ); when( buildingRequest.getRemoteRepositories() ).thenReturn( mojo.project.getRemoteArtifactRepositories() ); when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest ); - MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession(); - repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepo ) ); + DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession(); + repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( repositorySession, new LocalRepository( localRepo ) ) ); when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession ); when( session.getRepositorySession() ).thenReturn( repositorySession ); LegacySupport legacySupport = lookup( LegacySupport.class );