From a4d0207b256f9946f305bf0ca0416c9ad293a7a1 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Mon, 11 Jul 2022 18:26:54 +0200 Subject: [PATCH] Require Maven 3.2.5 --- pom.xml | 33 ++++++++----------- .../codehaus/mojo/exec/ExecJavaMojoTest.java | 9 ++--- .../org/codehaus/mojo/exec/ExecMojoTest.java | 7 +--- 3 files changed, 18 insertions(+), 31 deletions(-) diff --git a/pom.xml b/pom.xml index 5bf495e5..ab55b0f2 100644 --- a/pom.xml +++ b/pom.xml @@ -148,7 +148,7 @@ plexus-component-annotations 2.1.1 true - + org.apache.commons @@ -162,11 +162,22 @@ 0.13.1 + + junit + junit + test + org.apache.maven.plugin-testing maven-plugin-testing-harness - 2.1 + 3.3.0 test + + + org.codehaus.plexus + plexus-container-default + + org.apache.maven @@ -195,8 +206,7 @@ - 3.0 - + 3.2.5 1.7.36 2022-01-18T09:14:02Z @@ -213,21 +223,6 @@ false - - org.apache.maven.plugins - maven-plugin-plugin - 3.6.4 - - exec - true - - - - default-descriptor - process-classes - - - diff --git a/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java b/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java index da0346d1..be926498 100644 --- a/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java +++ b/src/test/java/org/codehaus/mojo/exec/ExecJavaMojoTest.java @@ -23,7 +23,6 @@ import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; -import java.nio.charset.StandardCharsets; import org.apache.maven.execution.MavenSession; import org.apache.maven.monitor.logging.DefaultLog; @@ -33,13 +32,12 @@ import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingRequest; -import org.apache.maven.repository.internal.MavenRepositorySystemSession; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.logging.console.ConsoleLogger; -import org.codehaus.plexus.util.StringOutputStream; +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; /** * @author Jerome Lacoste @@ -341,8 +339,7 @@ private void setUpProject( File pomFile, AbstractMojo mojo ) ProjectBuildingRequest buildingRequest = mock( ProjectBuildingRequest.class ); when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest ); - MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession(); - repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) ); + RepositorySystemSession repositorySession = new DefaultRepositorySystemSession(); when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession ); ProjectBuilder builder = lookup( ProjectBuilder.class ); diff --git a/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java b/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java index e588c0af..66ec7c4d 100644 --- a/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java +++ b/src/test/java/org/codehaus/mojo/exec/ExecMojoTest.java @@ -35,13 +35,11 @@ import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingRequest; -import org.apache.maven.repository.internal.MavenRepositorySystemSession; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.logging.console.ConsoleLogger; import org.codehaus.plexus.util.StringOutputStream; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager; /** * @author Jerome Lacoste @@ -250,10 +248,7 @@ private void setUpProject( File pomFile, ExecMojo mojo ) ProjectBuildingRequest buildingRequest = mock( ProjectBuildingRequest.class ); when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest ); - MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession(); - repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) ); - when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession ); - + ProjectBuilder builder = lookup( ProjectBuilder.class ); mojo.setBasedir( File.createTempFile( "mvn-temp", "txt" ).getParentFile() );