You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2024/04/24 11:32:26 UTC

[PR] Use the new resolver provider [maven]

gnodet opened a new pull request, #1483:
URL: https://github.com/apache/maven/pull/1483

   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed
          for the change (usually before you start working on it).  Trivial changes like typos do not
          require a JIRA issue. Your pull request should address just this issue, without
          pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[MNG-XXX] SUMMARY`,
          where you replace `MNG-XXX` and `SUMMARY` with the appropriate JIRA issue.
    - [ ] Also format the first line of the commit message like `[MNG-XXX] SUMMARY`.
          Best practice is to use the JIRA issue title in both the pull request title and in the first line of the commit message.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
          be performed on your pull request automatically.
    - [ ] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use the new resolver provider [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #1483:
URL: https://github.com/apache/maven/pull/1483#issuecomment-2076624606

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use the new resolver provider [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1483:
URL: https://github.com/apache/maven/pull/1483#discussion_r1579062435


##########
maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/MavenVersionScheme.java:
##########
@@ -19,20 +19,35 @@
 package org.apache.maven.internal.impl.resolver;
 
 import org.apache.maven.api.di.Named;
-import org.apache.maven.api.di.Provides;
 import org.apache.maven.api.di.Singleton;
 import org.eclipse.aether.util.version.GenericVersionScheme;
+import org.eclipse.aether.version.InvalidVersionSpecificationException;
+import org.eclipse.aether.version.Version;
+import org.eclipse.aether.version.VersionConstraint;
+import org.eclipse.aether.version.VersionRange;
 import org.eclipse.aether.version.VersionScheme;
 
 /**
  * Default version scheme provider: provides singleton {@link GenericVersionScheme} instance.
  */
 @Singleton
 @Named
-public final class DefaultVersionSchemeProvider {
+public class MavenVersionScheme implements VersionScheme {
 
-    @Provides
-    static VersionScheme getVersionScheme() {
-        return new GenericVersionScheme();
+    private final VersionScheme delegate = new GenericVersionScheme();

Review Comment:
   @cstamas fwiw, it would be easier if `GenericVersionScheme` was not `final`...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use the new resolver provider [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #1483:
URL: https://github.com/apache/maven/pull/1483


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use the new resolver provider [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #1483:
URL: https://github.com/apache/maven/pull/1483#issuecomment-2076658759

   > 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).
   
   ```
   [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) 
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use the new resolver provider [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1483:
URL: https://github.com/apache/maven/pull/1483#discussion_r1579073510


##########
maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/MavenVersionScheme.java:
##########
@@ -19,20 +19,35 @@
 package org.apache.maven.internal.impl.resolver;
 
 import org.apache.maven.api.di.Named;
-import org.apache.maven.api.di.Provides;
 import org.apache.maven.api.di.Singleton;
 import org.eclipse.aether.util.version.GenericVersionScheme;
+import org.eclipse.aether.version.InvalidVersionSpecificationException;
+import org.eclipse.aether.version.Version;
+import org.eclipse.aether.version.VersionConstraint;
+import org.eclipse.aether.version.VersionRange;
 import org.eclipse.aether.version.VersionScheme;
 
 /**
  * Default version scheme provider: provides singleton {@link GenericVersionScheme} instance.
  */
 @Singleton
 @Named
-public final class DefaultVersionSchemeProvider {
+public class MavenVersionScheme implements VersionScheme {
 
-    @Provides
-    static VersionScheme getVersionScheme() {
-        return new GenericVersionScheme();
+    private final VersionScheme delegate = new GenericVersionScheme();

Review Comment:
   > 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...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use the new resolver provider [maven]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on code in PR #1483:
URL: https://github.com/apache/maven/pull/1483#discussion_r1579067049


##########
maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/MavenVersionScheme.java:
##########
@@ -19,20 +19,35 @@
 package org.apache.maven.internal.impl.resolver;
 
 import org.apache.maven.api.di.Named;
-import org.apache.maven.api.di.Provides;
 import org.apache.maven.api.di.Singleton;
 import org.eclipse.aether.util.version.GenericVersionScheme;
+import org.eclipse.aether.version.InvalidVersionSpecificationException;
+import org.eclipse.aether.version.Version;
+import org.eclipse.aether.version.VersionConstraint;
+import org.eclipse.aether.version.VersionRange;
 import org.eclipse.aether.version.VersionScheme;
 
 /**
  * Default version scheme provider: provides singleton {@link GenericVersionScheme} instance.
  */
 @Singleton
 @Named
-public final class DefaultVersionSchemeProvider {
+public class MavenVersionScheme implements VersionScheme {
 
-    @Provides
-    static VersionScheme getVersionScheme() {
-        return new GenericVersionScheme();
+    private final VersionScheme delegate = new GenericVersionScheme();

Review Comment:
   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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use the new resolver provider [maven]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #1483:
URL: https://github.com/apache/maven/pull/1483#issuecomment-2076626551

   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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org