slachiewicz opened a new pull request, #54:
URL: https://github.com/apache/nifi-maven/pull/54
# Summary
No NiFi Jira issue yet; one still needs to be filed, and its key should then
go into the title and commit message.
maven-dependency-tree is planned to be retired
(apache/maven-dependency-tree#151). This replaces it with a small
`org.apache.nifi.dependency` package on top of maven-core and Maven Resolver:
- `DependencyGraphBuilder` (a `@Named @Singleton` component, injected where
the old builders were):
- `buildDependencyGraph(ProjectBuildingRequest, ArtifactFilter)` builds
the resolved graph through `ProjectDependenciesResolver`, with a resolution
filter that downloads no artifact files. maven-dependency-tree's
`DependencyGraphBuilder` did the same.
- `collectDependencyGraph(ProjectBuildingRequest, ArtifactFilter)` builds
the verbose graph through `RepositorySystem.collectDependencies`, with the
selector, conflict resolver and verbose settings of maven-dependency-tree's
`DependencyCollectorBuilder`. `NarDuplicateDependenciesMojo` relies on that
graph keeping dependencies that lose a version conflict.
- `DependencyNode` and `DependencyNodeVisitor` keep the traversal (`accept`,
`visit`/`endVisit`) and `toNodeString()` of the old types, so `NarMojo`,
`NarProvidedDependenciesMojo`, `NarDuplicateDependenciesMojo` and
`ExtensionClassLoaderFactory` only change imports and exception types.
- `DirectScopeDependencySelector` is ported from maven-dependency-tree. Its
`VerboseJavaScopeSelector` only recorded a reduced-scope marker that nifi-maven
never reads, so Resolver's `JavaScopeSelector` is used instead.
The direct `maven-dependency-tree` dependency is removed. It still arrives
transitively through `maven-dependency-plugin` 3.11.0, until a release of that
plugin that includes MDEP-969 (apache/maven-dependency-plugin#1712).
# Tracking
### Issue Tracking
- [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue
created (still to be filed)
### Pull Request Tracking
- [ ] Pull Request title starts with Apache NiFi Jira issue number (once
filed)
- [ ] Pull Request commit message starts with Apache NiFi Jira issue number
(once filed)
- [ ] Pull request contains commits signed with a registered key indicating
`Verified` status (not yet signed)
# Verification
- `mvn verify` passes: 15 tests, 6 of them new in
`DependencyGraphBuilderTest`. They cover the conversion of the Resolver graph
(root, scope, optional, filtered subtrees), the verbose collection settings,
the error message, the visitor traversal and the scope selector.
- I compared the plugin built from `main` with this branch on a sample NAR
that depends on `nifi-standard-services-api-nar` 2.12.0, a duplicated
`nifi-utils` and a conflicting `slf4j-api`. All of these are identical:
- `provided-nar-dependencies` output in `tree` and `pom` mode;
- the `duplicate-nar-dependencies` report, with the same three duplicates
found through the verbose graph;
- the 112 class-loader URLs gathered by `ExtensionClassLoaderFactory`
during `package`;
- the NAR's contents;
- the exit codes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]