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

Use the new resolver provider #1483

Merged
merged 2 commits into from
Apr 25, 2024
Merged

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Apr 24, 2024

There's a mix of usage between the v3 maven-resolver-provider and the new one located in maven-api-impl...

@gnodet gnodet marked this pull request as draft April 24, 2024 12:10
@gnodet gnodet marked this pull request as ready for review April 25, 2024 08:09
@gnodet gnodet requested a review from cstamas April 25, 2024 08:09
@Provides
static VersionScheme getVersionScheme() {
return new GenericVersionScheme();
private final VersionScheme delegate = new GenericVersionScheme();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cstamas fwiw, it would be easier if GenericVersionScheme was not final...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any other thing to make non final in resolver? Resolver was notorious about making all stuff final, and I did not want to change a lot there... I can do a sweeping change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any other thing to make non final in resolver? Resolver was notorious about making all stuff final, and I did not want to change a lot there... I can do a sweeping change

That's really the one that needed a workaround in my recent changes...

@gnodet
Copy link
Contributor Author

gnodet commented Apr 25, 2024

@cstamas I wonder if we should deprecate all the classes in maven-resolver-provider at the same time ... ?

@cstamas
Copy link
Member

cstamas commented Apr 25, 2024

Agreed, if maven-api-impl

  • provides all is needed to maven-core at runtime, &&
  • "mima like" use cases are from now to use maven-api-impl (instead of maven-resolver-provider)
    Then yes

@gnodet gnodet added this to the 4.0.0-beta-1 milestone Apr 25, 2024
@gnodet
Copy link
Contributor Author

gnodet commented Apr 25, 2024

Agreed, if maven-api-impl

  • provides all is needed to maven-core at runtime, &&
  • "mima like" use cases are from now to use maven-api-impl (instead of maven-resolver-provider)
    Then yes

The maven-resolver-provider isn't used anymore but for direct references. The sisu plugin is disabled, so that all the beans from this jar are not discovered at runtime by sisu.
If I remove maven-resolver-provider from the maven distribution and try to build maven, the build fails because m-remote-resources-p is directly calling the project builder (so the v3 one). However, the fact that the whole project is read and build started, clearly means the resolver as a correct provider wired in (and obviously not the v3 one).

But there's no urge to deprecate those, we can do that after beta-1...

[INFO] --- remote-resources:3.2.0:process (process-resource-bundles) @ maven-api-di ---
[INFO] Preparing remote bundle org.apache.apache.resources:apache-jar-resource-bundle:1.5
[INFO] Copying 3 resources from 1 bundle.
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Reactor Summary for Apache Maven 4.0.0-alpha-14-SNAPSHOT:
[INFO] 
[INFO] Apache Maven ......................................................................................... SUCCESS [  3.142 s]
[INFO] Maven 4 API .......................................................................................... SUCCESS [  0.079 s]
[INFO] Maven 4 API :: Meta annotations ...................................................................... SUCCESS [  0.788 s]
[INFO] Maven 4 API :: Dependency Injection .................................................................. FAILURE [  0.059 s]
[INFO] Maven 4 API :: XML ................................................................................... SKIPPED
[INFO] Maven 4 API :: Model ................................................................................. SKIPPED
[INFO] Maven 4 API :: Plugin ................................................................................ SKIPPED
[INFO] Maven 4 API :: Settings .............................................................................. SKIPPED
[INFO] Maven 4 API :: Toolchain ............................................................................. SKIPPED
[INFO] Maven 4 API :: Repository Metadata ................................................................... SKIPPED
[INFO] Maven 4 API :: Core .................................................................................. SKIPPED
[INFO] Maven 4 API :: SPI ................................................................................... SKIPPED
[INFO] Maven Dependency Injection ........................................................................... SKIPPED
[INFO] Maven XML API Implementation ......................................................................... SKIPPED
[INFO] Maven API Implementation ............................................................................. SKIPPED
[INFO] Maven Model .......................................................................................... SKIPPED
[INFO] Maven Artifact ....................................................................................... SKIPPED
[INFO] Maven Plugin API ..................................................................................... SKIPPED
[INFO] Maven Builder Support ................................................................................ SKIPPED
[INFO] Maven Model Builder .................................................................................. SKIPPED
[INFO] Maven JLine integration .............................................................................. SKIPPED
[INFO] Maven Settings ....................................................................................... SKIPPED
[INFO] Maven Settings Builder ............................................................................... SKIPPED
[INFO] Maven Toolchain Model ................................................................................ SKIPPED
[INFO] Maven Toolchain Builder .............................................................................. SKIPPED
[INFO] Maven Repository Metadata Model ...................................................................... SKIPPED
[INFO] Maven Artifact Resolver Provider ..................................................................... SKIPPED
[INFO] Maven Core ........................................................................................... SKIPPED
[INFO] Maven SLF4J Wrapper .................................................................................. SKIPPED
[INFO] Maven SLF4J Simple Provider .......................................................................... SKIPPED
[INFO] Maven Embedder ....................................................................................... SKIPPED
[INFO] Maven Compat (deprecated) ............................................................................ SKIPPED
[INFO] Apache Maven Distribution ............................................................................ SKIPPED
[INFO] Maven Dependencies BOM ............................................................................... SKIPPED
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Total time:  4.349 s
[INFO] Finished at: 2024-04-25T10:20:29+02:00
[INFO] --------------------------------------------------------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:3.2.0:process (process-resource-bundles) on project maven-api-di: Execution process-resource-bundles of goal org.apache.maven.plugins:maven-remote-resources-plugin:3.2.0:process failed: A required class was missing while executing org.apache.maven.plugins:maven-remote-resources-plugin:3.2.0:process: org/apache/maven/repository/internal/ArtifactDescriptorUtils
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-remote-resources-plugin:3.2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/gnodet/.m2/repository/org/apache/maven/plugins/maven-remote-resources-plugin/3.2.0/maven-remote-resources-plugin-3.2.0.jar
[ERROR] urls[1] = file:/Users/gnodet/.m2/repository/org/apache/maven/maven-archiver/3.6.1/maven-archiver-3.6.1.jar
[ERROR] urls[2] = file:/Users/gnodet/.m2/repository/org/codehaus/plexus/plexus-archiver/4.8.0/plexus-archiver-4.8.0.jar
[ERROR] urls[3] = file:/Users/gnodet/.m2/repository/org/codehaus/plexus/plexus-io/3.4.1/plexus-io-3.4.1.jar
[ERROR] urls[4] = file:/Users/gnodet/.m2/repository/org/apache/commons/commons-compress/1.23.0/commons-compress-1.23.0.jar
[ERROR] urls[5] = file:/Users/gnodet/.m2/repository/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
[ERROR] urls[6] = file:/Users/gnodet/.m2/repository/org/tukaani/xz/1.9/xz-1.9.jar
[ERROR] urls[7] = file:/Users/gnodet/.m2/repository/com/github/luben/zstd-jni/1.5.5-5/zstd-jni-1.5.5-5.jar
[ERROR] urls[8] = file:/Users/gnodet/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.26/plexus-interpolation-1.26.jar
[ERROR] urls[9] = file:/Users/gnodet/.m2/repository/org/apache/maven/shared/maven-filtering/3.3.2/maven-filtering-3.3.2.jar
[ERROR] urls[10] = file:/Users/gnodet/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
[ERROR] urls[11] = file:/Users/gnodet/.m2/repository/commons-io/commons-io/2.15.1/commons-io-2.15.1.jar
[ERROR] urls[12] = file:/Users/gnodet/.m2/repository/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar
[ERROR] urls[13] = file:/Users/gnodet/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/3.3.2/maven-common-artifact-filters-3.3.2.jar
[ERROR] urls[14] = file:/Users/gnodet/.m2/repository/org/codehaus/plexus/plexus-resources/1.3.0/plexus-resources-1.3.0.jar
[ERROR] urls[15] = file:/Users/gnodet/.m2/repository/org/codehaus/plexus/plexus-utils/4.0.0/plexus-utils-4.0.0.jar
[ERROR] urls[16] = file:/Users/gnodet/.m2/repository/org/codehaus/plexus/plexus-xml/3.0.0/plexus-xml-3.0.0.jar
[ERROR] urls[17] = file:/Users/gnodet/.m2/repository/org/apache/velocity/velocity-engine-core/2.3/velocity-engine-core-2.3.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] : org.apache.maven.repository.internal.ArtifactDescriptorUtils
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the '-e' switch
[ERROR] Re-run Maven using the '-X' switch to enable verbose output
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn [args] -r
➜  maven git:(use-new-resolver-provider) 

@gnodet gnodet force-pushed the use-new-resolver-provider branch from 79059ba to c09dcea Compare April 25, 2024 11:45
@gnodet gnodet merged commit 6fddd97 into apache:master Apr 25, 2024
13 checks passed
@gnodet gnodet deleted the use-new-resolver-provider branch June 11, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants