-
Notifications
You must be signed in to change notification settings - Fork 267
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
Remove usages of deprecated Maven 2 references (like maven-compat) #704
Comments
Next one: #713 |
Working on migrating to Maven 3. |
Please one by one if possible 😄 |
I think the hardest part was #825, the rest should be easy 😄 |
@slawekjaranowski I have a question. Do we still need to provide Maven 2 backward compatibility in case of plugin repos? I've created this, but am now thinking whether it is really needed... /**
* Provides backward-compat with 2.x that allowed plugins like the maven-remote-resources-plugin:1.0 to
* populate the builder configuration with model repositories instead of artifact repositories.
*
* @param repositories list of remote repositories
* @param session {@link RepositorySystemSession} instance
* @param repositorySystem {@link RepositorySystem} instance
* @return list of repositories converted to {@link ArtifactRepository} objects
* @throws InvalidRepositoryException if the remote repository cannot be reconstructed
*
* @since 2.14.0
*/
public static List<ArtifactRepository> normalizeToArtifactRepositories( List<?> repositories,
RepositorySystemSession session,
RepositorySystem repositorySystem )
throws InvalidRepositoryException
{
try
{
return repositories
.stream()
.filter( o -> o instanceof Repository )
.map( o -> (Repository) o )
.map( r ->
{
try
{
ArtifactRepository repo = repositorySystem.buildArtifactRepository( r );
repositorySystem.injectMirror( session, singletonList( repo ) );
repositorySystem.injectProxy( session, singletonList( repo ) );
repositorySystem.injectAuthentication( session, singletonList( repo ) );
return repo;
}
catch ( InvalidRepositoryException e )
{
throw new IllegalArgumentException( e );
}
} )
.collect( Collectors.toList() );
}
catch ( IllegalArgumentException e )
{
throw (InvalidRepositoryException) e.getCause();
}
} |
NO, to remove, I saw similar code in Maven core - not needed in plugin |
Good, we also have Maven 2 compat code in DisplayPluginUpdates, I'll remove that too. |
So this whole procedure is not necessary anymore? /**
* Retrieves the standalone superproject
*
* @param projectBuilder {@link ProjectBuilder} instance
* @param mavenSession {@link MavenSession} instance
* @param logger The logger to log tog
*
* @return superproject retrieved
* @throws ProjectBuildingException if the retrieval fails
*/
public static MavenProject getStandaloneSuperProject( ProjectBuilder projectBuilder,
MavenSession mavenSession,
Log logger ) throws ProjectBuildingException
{
ProjectBuildingResult result = projectBuilder.build( new UrlModelSource(
Objects.requireNonNull( PomHelper.class.getResource( "standalone.xml" ) ) ),
createProjectBuilderRequest( mavenSession, r -> r.setProcessPlugins( false ) ) );
if ( result.getProblems() != null )
{
logger.warn( "Problems encountered during building of the superproject." );
result.getProblems().forEach( p ->
logger.warn( "\t" + p.getMessage() ) );
}
return result.getProject();
} used in: getLog().debug( "Using Maven 2.x strategy to determine superpom defined plugins" );
Map<String, String> superPomPluginManagement;
try
{
superPomPluginManagement = new HashMap<>( getPluginManagement(
PomHelper.getStandaloneSuperProject( projectBuilder, session, getLog() ).getOriginalModel() ) );
}
catch ( ProjectBuildingException e )
{
throw new MojoExecutionException( "Could not determine the super pom.xml", e );
} |
Wagon -> straight to Transporter I really, really hope it's the right way I'm following. I got it from this picture: https://maven.apache.org/resolver/ Wagon is delegated to by Transporter, but I believe it's the future-proof interface. |
… version resolution
… version resolution
… version resolution
… version resolution
I have a question. I wanted to remove the Which one should I use instead? org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException |
… version resolution
… version resolution
Can be closed @slawekjaranowski |
as usual Maven dev list is the best place to ask, |
I hope yes - very good job @ajarmoniuk thanks |
we should migrate all to new Maven 3 replacements
MavenProjectBuilder projectBuilder,
ArtifactMetadataSource artifactMetadataSource,
WagonManager wagonManager,
ArtifactResolver artifactResolver
The text was updated successfully, but these errors were encountered: