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

[GitHub] [maven] cstamas opened a new pull request, #1124: [MNG-7097] Plugin Dependency Resolution

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

   Idea: maven plugin dependency resolution could do it smarter: currently, it _resolves_ all dependencies of a plugin, only to leave them (exclude from classpath) if they are present in Maven Core and are exported. So, why not filter ahead instead?
   
   Plugin resolution filter, part one: The Filter
   
   ## Simple "tests" for numbers
   
   CMD: `mvn clean install -Dmaven.repo.local=local -Drat.skip` (and always emptying local repo naturally)
   
   ### Building maven-3.9.x
   
   The local repo size and file count contained.
   
   w/ 3.9.2:
   Size: 147MB
   Files: 3301
   
   w/ 3.9.3 + this PR:
   Size: 131MB
   Files: 2506
   
   ### Building maven-3.8.x
   
   w/ 3.9.2:
   Size: 142MB
   Files: 4500
   
   w/ 3.9.3 + this PR:
   Size: 117MB
   Files: 3362
   
   Conclusion: the "saving" (in transported byte count and file count, downloaded from remote) is bigger as "older" the plugins are (3.9.x uses parent 39, while 3.8.x parent 36). Essentially, putting maven bits to "provided" scope results in same result as this PR makes it. The difference is that this filter works for ALL, even old, non-provided plugins as well.
   
   ---
   
   https://issues.apache.org/jira/browse/MNG-7097


-- 
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 closed pull request #1124: [MNG-7097] Plugin Dependency Resolution

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas closed pull request #1124: [MNG-7097] Plugin Dependency Resolution
URL: https://github.com/apache/maven/pull/1124


-- 
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 pull request #1124: [MNG-7097] Plugin Dependency Resolution

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

   I think the IT bootstrap needs some adjustments as some artifacts are missing.


-- 
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 pull request #1124: [MNG-7097] Plugin Dependency Resolution

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

   As expected, with "part one" IT results:
   ```
   Error:  Tests run: 889, Failures: 2, Errors: 5, Skipped: 80
   ```
   
   Failed ITs:
   * MavenITmng4274PluginRealmArtifactsTest.testit
   * MavenITmng5783PluginDependencyFiltering.testSLF4j
   
   Errored ITs:
   * MavenITmng3536AppendedAbsolutePathsTest
   * MavenITmng3693PomFileBasedirChangeTest.testitMNG3693
   * MavenITmng4360WebDavSupportTest.testitJackrabbitBasedImpl
   * MavenITmng4360WebDavSupportTest.testitSlideBasedImpl:
   * MavenITmng7045DropUselessAndOutdatedCdiApiTest.testShouldNotLeakCdiApi:
   


-- 
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 diff in pull request #1124: [MNG-7097] Plugin Dependency Resolution

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


##########
maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultPluginDependenciesResolver.java:
##########
@@ -300,4 +311,40 @@ public boolean visitLeave(DependencyNode node) {
             return true;
         }
     }
+
+    private static class CoreDependencySelector implements DependencySelector {
+        private final HashSet<String> coreArtifacts;
+
+        private CoreDependencySelector(final Collection<String> coreArtifacts) {
+            this.coreArtifacts = new HashSet<>(coreArtifacts);
+        }
+
+        @Override
+        public boolean selectDependency(final org.eclipse.aether.graph.Dependency dependency) {

Review Comment:
   I'm not a big fan of the `final` keyword on arguments and local variable... They are actually only useful on fields.



-- 
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 pull request #1124: [MNG-7097] Plugin Dependency Resolution

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

   Bad approach: by "cutting" the graph we cut potentially 2nd, 3rd level transitive dependencies (like in case of MNG4360 IT, where jackrabbit-wagon _directly uses_ plexus-utils classes, but for it p-u is 3rd level transitive dependency :shrug: 


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