Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRELEASE-1084] Upgrade Maven to 3.2.5 #106

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions maven-release-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
<artifactId>maven-settings</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
<version>1.0.0.v20140518</version>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-util</artifactId>
<version>${resolverVersion}</version>
<optional>true</optional>
</dependency>

Expand Down
12 changes: 6 additions & 6 deletions maven-release-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-connector-file</artifactId>
<version>1.7</version>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-file</artifactId>
<version>${resolverVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-connector-wagon</artifactId>
<version>1.7</version>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-wagon</artifactId>
<version>${resolverVersion}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.codehaus.plexus.ContainerConfiguration;
import org.codehaus.plexus.DefaultContainerConfiguration;
import org.codehaus.plexus.DefaultPlexusContainer;
import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.PlexusContainerException;
import org.codehaus.plexus.configuration.PlexusConfiguration;
Expand Down Expand Up @@ -86,7 +87,8 @@ protected void setupContainer()
final String config = getCustomConfigurationName();

final ContainerConfiguration containerConfiguration =
new DefaultContainerConfiguration().setName( "test" ).setContext( context.getContextData() ).setClassPathCaching( true );
new DefaultContainerConfiguration().setName( "test" ).setContext( context.getContextData() )
.setClassPathScanning( PlexusConstants.SCANNING_CACHE );

if ( config != null )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@
import org.apache.maven.project.artifact.InvalidDependencyVersionException;
import org.apache.maven.project.ProjectBuildingResult;
import org.apache.maven.project.ProjectSorter;
import org.apache.maven.repository.internal.MavenRepositorySystemSession;
import org.apache.maven.shared.release.PlexusJUnit4TestCase;
import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder;
import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
import org.sonatype.aether.repository.WorkspaceReader;
import org.sonatype.aether.repository.WorkspaceRepository;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.WorkspaceReader;
import org.eclipse.aether.repository.WorkspaceRepository;
import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory;
import org.xmlunit.builder.DiffBuilder;
import org.xmlunit.diff.Comparison;
import org.xmlunit.diff.ComparisonResult;
Expand All @@ -84,9 +85,11 @@ public abstract class AbstractReleaseTestCase
protected ProjectBuilder projectBuilder;

protected ArtifactRepository localRepository;

private ArtifactFactory artifactFactory;

private LocalRepositoryManagerFactory lrmFactory;

protected ReleasePhase phase;

@Override
Expand All @@ -96,11 +99,13 @@ public void setUp()
super.setUp();

projectBuilder = lookup( ProjectBuilder.class );
artifactFactory = lookup( ArtifactFactory.class );
artifactFactory = lookup( ArtifactFactory.class );

ArtifactRepositoryLayout layout = lookup( ArtifactRepositoryLayout.class, "default" );
String localRepoPath = getTestFile( "target/local-repository" ).getAbsolutePath().replace( '\\', '/' );
localRepository = new MavenArtifactRepository( "local", "file://" + localRepoPath, layout, null, null );

lrmFactory = lookup( LocalRepositoryManagerFactory.class, "simple" );
}

protected Path getWorkingDirectory( String workingDir )
Expand All @@ -113,7 +118,7 @@ protected List<MavenProject> createReactorProjects( String path, String subpath
{
return createReactorProjects( path, path, subpath );
}

protected ReleaseDescriptorBuilder createReleaseDescriptorBuilder( List<MavenProject> reactorProjects )
{
ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
Expand Down Expand Up @@ -187,8 +192,9 @@ public FileVisitResult visitFile( Path file, BasicFileAttributes attrs )
buildingRequest.setRemoteRepositories( repos );
buildingRequest.setPluginArtifactRepositories( repos );
buildingRequest.setRepositoryMerging( RepositoryMerging.REQUEST_DOMINANT );
MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( localRepository.getBasedir() ) );
DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession();
repositorySession.setLocalRepositoryManager( lrmFactory.newInstance( repositorySession,
new LocalRepository( "target/local-repository" ) ) );
buildingRequest.setRepositorySession( repositorySession );
buildingRequest.addProfile( profile );
buildingRequest.setActiveProfileIds( Arrays.asList( profile.getId() ) );
Expand All @@ -213,7 +219,7 @@ public FileVisitResult visitFile( Path file, BasicFileAttributes attrs )
for ( MavenProject project : reactorProjects )
{
MavenProject resolvedProject = projectBuilder.build( project.getFile(), buildingRequest ).getProject();

// from LifecycleDependencyResolver
if ( project.getDependencyArtifacts() == null )
{
Expand All @@ -226,7 +232,7 @@ public FileVisitResult visitFile( Path file, BasicFileAttributes attrs )
throw new LifecycleExecutionException( e );
}
}

resolvedProjects.add( resolvedProject );
}
return resolvedProjects;
Expand Down Expand Up @@ -387,7 +393,7 @@ public WorkspaceRepository getRepository()
}

@Override
public List<String> findVersions( org.sonatype.aether.artifact.Artifact artifact )
public List<String> findVersions( org.eclipse.aether.artifact.Artifact artifact )
{
for ( MavenProject mavenProject : reactorProjects )
{
Expand All @@ -400,7 +406,7 @@ public List<String> findVersions( org.sonatype.aether.artifact.Artifact artifact
}

@Override
public File findArtifact( org.sonatype.aether.artifact.Artifact artifact )
public File findArtifact( org.eclipse.aether.artifact.Artifact artifact )
{
for ( MavenProject mavenProject : reactorProjects )
{
Expand All @@ -419,4 +425,4 @@ else if ( Objects.equals( artifact.toString(), mavenProject.getArtifact().toStri
return null;
}
}
}
}
6 changes: 3 additions & 3 deletions maven-release-policies/maven-release-oddeven-policy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
<version>1.0.0.v20140518</version>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-util</artifactId>
<version>${resolverVersion}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
<properties>
<scmVersion>1.12.2</scmVersion>
<javaVersion>8</javaVersion>
<mavenVersion>3.0</mavenVersion>
<mavenVersion>3.5.4</mavenVersion>
<resolverVersion>1.1.1</resolverVersion>
<maven.site.path>maven-release-archives/maven-release-LATEST</maven.site.path>
<project.build.outputTimestamp>2022-01-02T10:18:49Z</project.build.outputTimestamp>
</properties>
Expand Down