Migrate from maven-dependency-tree to direct use of Resolver API#749
Migrate from maven-dependency-tree to direct use of Resolver API#749flowerlake wants to merge 11 commits intojenkinsci:masterfrom
Conversation
|
@basil please take a look |
basil
left a comment
There was a problem hiding this comment.
Looks about right at face value. Does it work?
|
Yes, it works good. I've successfully tested the builds for both jira-plugin and saml-plugin on the current fix branch. All are working as expected. hpi3.66-rc1725.30105a_a_2f65d are from CI-PR-749 |
|
Do those logs show that the code changed in this PR was executed? |
|
I have performed additional testing with the command: jira-hpi-assemble-dependencies-3.65.log |
|
Hi, @basil any other questions? |
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the codebase from using the maven-dependency-tree library to the direct use of the Resolver API for dependency graph traversal. This change modernizes the dependency resolution approach by leveraging Eclipse Aether's more direct API instead of the Maven-specific wrapper.
Key changes:
- Replace maven-dependency-tree with Eclipse Aether Resolver API
- Update method signatures to include root node tracking
- Refactor dependency graph building logic to use native Aether components
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pom.xml | Removes the maven-dependency-tree dependency |
| AbstractDependencyGraphTraversingMojo.java | Replaces maven-dependency-tree with Aether Resolver API and adds root node tracking |
| AssembleDependenciesMojo.java | Updates method signature and adapts to new Aether-based dependency handling |
src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractDependencyGraphTraversingMojo.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jenkinsci/maven/plugins/hpi/AssembleDependenciesMojo.java
Show resolved
Hide resolved
src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractDependencyGraphTraversingMojo.java
Outdated
Show resolved
Hide resolved
basil
left a comment
There was a problem hiding this comment.
This PR is changing existing behavior, seemingly unintentionally. Before this PR, running the Mojo in workflow-job I get:
"ionicons-api" -> {MavenArtifact@4715} "io.jenkins.plugins:ionicons-api:jar:74.v93d5eb_813d5f"
"caffeine-api" -> {MavenArtifact@4717} "io.jenkins.plugins:caffeine-api:jar:3.1.8-133.v17b_1ff2e0599"
"workflow-support" -> {MavenArtifact@4719} "org.jenkins-ci.plugins.workflow:workflow-support:jar:944.v5a_859593b_98a_"
"workflow-step-api" -> {MavenArtifact@4721} "org.jenkins-ci.plugins.workflow:workflow-step-api:jar:686.v603d058a_e148"
"workflow-api" -> {MavenArtifact@4723} "org.jenkins-ci.plugins.workflow:workflow-api:jar:1363.v03f731255494"
"workflow-job" -> {MavenArtifact@4725} "org.jenkins-ci.plugins.workflow:workflow-job:hpi:999999-SNAPSHOT"
After this PR, I get
"ionicons-api" -> {MavenArtifact@4981} "io.jenkins.plugins:ionicons-api:jar:74.v93d5eb_813d5f"
"structs" -> {MavenArtifact@4983} "org.jenkins-ci.plugins:structs:jar:338.v848422169819"
"asm-api" -> {MavenArtifact@4985} "io.jenkins.plugins:asm-api:jar:9.7.1-97.v4cc844130d97"
"caffeine-api" -> {MavenArtifact@4987} "io.jenkins.plugins:caffeine-api:jar:3.1.8-133.v17b_1ff2e0599"
"scm-api" -> {MavenArtifact@4989} "org.jenkins-ci.plugins:scm-api:jar:703.v72ff4b_259600"
"script-security" -> {MavenArtifact@4998} "org.jenkins-ci.plugins:script-security:jar:1369.v9b_98a_4e95b_2d"
"workflow-support" -> {MavenArtifact@4991} "org.jenkins-ci.plugins.workflow:workflow-support:jar:944.v5a_859593b_98a_"
"workflow-step-api" -> {MavenArtifact@4993} "org.jenkins-ci.plugins.workflow:workflow-step-api:jar:686.v603d058a_e148"
"workflow-api" -> {MavenArtifact@4996} "org.jenkins-ci.plugins.workflow:workflow-api:jar:1363.v03f731255494"
"workflow-job" -> {MavenArtifact@4927} "org.jenkins-ci.plugins.workflow:workflow-job:hpi:999999-SNAPSHOT"
I fixed this to maintain consistency with the previous behavior, the inconsistency is due to the incorrect use of the |

Fixes #511
Testing done
I'm working on migrating the
maven-dependency-treeto useResolver Api. After searching through the repository globally, I identified two class files that involve API calls to this dependency -AssembleDependenciesMojoandAbstractDependencyGraphTraversingMojo.I'd be very happy if my contribution proves useful to the project.
Submitter checklist