Skip to content

Commit

Permalink
Switch to org.eclipse
Browse files Browse the repository at this point in the history
  • Loading branch information
cstamas committed Apr 16, 2022
1 parent 8a8c37b commit 5ac3a39
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 5ac3a39

Please # to comment.