You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/10/03 13:08:31 UTC

[GitHub] [maven] cstamas opened a new pull request #563: [MNG-7103] VersionScheme provider

cstamas opened a new pull request #563:
URL: https://github.com/apache/maven/pull/563


   This PR makes VersionScheme a component, is injected where needed
   (instead of ad-hoc instantiation), but provides room for
   different schemas, as GenericVersionScheme is "default"
   but now nothing stops to add other schemes as well.


-- 
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



[GitHub] [maven] cstamas merged pull request #563: [MNG-7103] VersionScheme provider

Posted by GitBox <gi...@apache.org>.
cstamas merged pull request #563:
URL: https://github.com/apache/maven/pull/563


   


-- 
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



[GitHub] [maven] gnodet commented on a change in pull request #563: [MNG-7103] VersionScheme provider

Posted by GitBox <gi...@apache.org>.
gnodet commented on a change in pull request #563:
URL: https://github.com/apache/maven/pull/563#discussion_r721149301



##########
File path: maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenResolverModule.java
##########
@@ -46,6 +47,7 @@
     protected void configure()
     {
         install( new AetherModule() );
+        bind( VersionScheme.class ).toProvider( new DefaultVersionSchemeProvider() );

Review comment:
       Just a quick question : is the explicit registration required ? Shouldn't sisu automatically wire the 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



[GitHub] [maven] cstamas commented on a change in pull request #563: [MNG-7103] VersionScheme provider

Posted by GitBox <gi...@apache.org>.
cstamas commented on a change in pull request #563:
URL: https://github.com/apache/maven/pull/563#discussion_r721154913



##########
File path: maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenResolverModule.java
##########
@@ -46,6 +47,7 @@
     protected void configure()
     {
         install( new AetherModule() );
+        bind( VersionScheme.class ).toProvider( new DefaultVersionSchemeProvider() );

Review comment:
       This class is NOT used in Maven, this is Guice module we provide for 3rd parties that use Guice for DI (so they can simply install this module and have "maven embedded"), as Resolver (the `AetherModule` above) itself is _incomplete_, Resolver has no notion of "maven models", have no idea how to read POM, repository metadata XML etc. This module "merely completes" resolver by adding "maven bits".
   
   Sisu will pick up the DefaultVersionSchemeProvider from sisu-index, as Sisu Mojo generates index for this module.
   
   Note: to use Guice modules within Sisu, you'd need a) directly add is somewhere (we do not), or b) annotate it with `@Named` (which is not) to have Sisu pick it up.
   
   Also, see https://github.com/apache/maven/pull/479 and related issue.




-- 
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



[GitHub] [maven] cstamas commented on a change in pull request #563: [MNG-7103] VersionScheme provider

Posted by GitBox <gi...@apache.org>.
cstamas commented on a change in pull request #563:
URL: https://github.com/apache/maven/pull/563#discussion_r721154913



##########
File path: maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenResolverModule.java
##########
@@ -46,6 +47,7 @@
     protected void configure()
     {
         install( new AetherModule() );
+        bind( VersionScheme.class ).toProvider( new DefaultVersionSchemeProvider() );

Review comment:
       This class is NOT used in Maven, this is Guice module we provide for 3rd parties that use pure Guice for DI (so they can simply install this module and have "maven embedded". Third parties using Sisu _dont need anything extra_ as our modules provide sisu-index), as Resolver (the `AetherModule` above) itself is _incomplete_, Resolver has no notion of "maven models", have no idea how to read POM, repository metadata XML etc. This module "merely completes" resolver by adding "maven bits".
   
   Sisu will pick up the DefaultVersionSchemeProvider from sisu-index, as Sisu Mojo generates index for this module.
   
   Note: to use Guice modules within Sisu, you'd need a) directly add is somewhere (we do not), or b) annotate it with `@Named` (which is not) to have Sisu pick it up.
   
   Also, see https://github.com/apache/maven/pull/479 and related issue.




-- 
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