slachiewicz commented on issue #13302: URL: https://github.com/apache/maven/issues/13302#issuecomment-5913975633
### maven-dependency-tree PR: apache/maven-dependency-tree#149. Status: **ported, verbose detail reduced**, 4.0.0-SNAPSHOT, Java 17. Verified locally: `mvn verify` with Maven 4.0.0-rc-7, JDK 21 → unit tests 2 before, 10 after, 0 failures; spotless clean. ITs (`-P run-its`): 6 passed, 4 failed **both before and after the port**. `verbose`, `verbose-war`, `maven-version` and `display-optional-information` fail on unported master too, because Maven 4 resolves `classworlds:1.1` where the expected output says `1.1-alpha-2`. That is a Maven 4 resolution change; the expected files were not rewritten. **Largely redundant with the v4 API.** `src/main` shrinks by 968 lines and grows by 276. - Both builders become thin wrappers over `DependencyResolver.collect(...)`, verbose via `verbose(true)`. - The verbose format already exists in core: `DefaultNode.asString()` in maven-impl is a near copy of `VerboseDependencyNode.toNodeString()`, without "scope not updated to", "(optional)" and "omitted for cycle/exclusion". - `Node.accept`, `Node.filter` and `Node.stream` cover plain visiting and filtering. **Still unique to this library:** `getParent()` (`api.Node` has no parent link; needed by `AncestorOrSelfDependencyNodeFilter` and the filtering and building visitors), the tree-drawing `SerializingDependencyNodeVisitor`, and the composable filters. **Public API changes** - `buildDependencyGraph(ProjectBuildingRequest, ArtifactFilter)` and `collectDependencyGraph(...)` → `(Session, Project, Predicate<Dependency>)`; the deprecated `reactorProjects` overload is removed. - `DependencyNode.getArtifact()` → `org.apache.maven.api.Artifact`; `getExclusions()` → `List<org.apache.maven.api.Exclusion>`; new `getDependency()`. - Removed: `getPremanagedVersion()`, `getPremanagedScope()`, `getVersionConstraint()`, the `DependencyCollectorRequest` selector, transformer and config properties, `VerboseDependencyNode`, `ConflictData`, `VerboseJavaScopeSelector`, `DirectScopeDependencySelector`. **Gaps** - Premanaged version and scope, version constraint, conflict winner and ignored scope have no structured accessor on `api.Node`; they exist only inside the `asString()` text. - A custom `DependencySelector` or `DependencyGraphTransformer` can't be set; `DependencyResolverRequest` has only `verbose`. - No route from `api.Session` to a `RepositorySystemSession` for plugins: `InternalSession` is in maven-impl, which maven-core does not export to plugin realms. So falling back to the Resolver API is not possible. **Consumers that break (compile):** maven-dependency-plugin (`TreeMojo`, its own `BuildingDependencyNodeVisitor`, and the DOT, TGF, GraphML and JSON serializers) and maven-project-info-reports-plugin (`DependenciesReport`, `DependencyConvergenceReport` and renderers). Both rely on premanaged and conflict data. **Recommendation:** port as a thin layer (parent links, serializer, filters) and keep 3.x for Maven 3 plugins. Don't promise premanaged or conflict data until `api.Node` exposes it; that is the API request to raise. -- 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]
