slachiewicz opened a new issue, #329: URL: https://github.com/apache/maven-dependency-analyzer/issues/329
The 1.x line is the version consumed today. `maven-dependency-plugin` pins 1.17.2, and external users include CycloneDX Maven Plugin, Qulice, Palantir Gradle Baseline, and gradle-dependency-analyze. PR #322 proposes a breaking 2.0 API that requires Maven 4 and Java 17; until that migration window opens, simplify the existing line without changing its public signatures or build requirements. ## Scope Keep Java 8 and the Maven 3 API. Make only internal changes or source-compatible additions. Every change must leave existing callers compiling and behaving identically. ## Proposed work 1. Simplify the internal dependency-matching loop in `DefaultProjectDependencyAnalyzer.removeAll`: replace the boolean `found` loop with `stream().anyMatch(...)`, keeping the current `dependencyConflictId` equality semantics rather than `Set.removeAll`. 2. Remove duplicated state in `ProjectDependencyAnalysis`. The class stores both `Map<Dependency, Set<DependencyUsage>>` and a separate `Set<Dependency>` for declared and undeclared results. Derive the set views from the map keys, and consolidate the two used-undeclared views (`Set<String>` and `Set<DependencyUsage>`) on one internal representation. 3. Deprecate the API members that 2.0 removes. Add `@Deprecated` with Javadoc pointing at replacements to the URL-based overloads in `DependencyAnalyzer` and `ClassAnalyzer`, and to the no-argument and "compatibility with old API" constructors in `ProjectDependencyAnalysis`. Deprecation is source-compatible and gives downstreams a migration signal. 4. Keep the test suite current: preserve per-class case counts, add coverage for the internal refactors, and update public Javadoc where the deprecations land. ## Out of scope Changing `Artifact` to `Dependency`, accepting `Path` instead of `URL` in signatures, passing `DependencyResolverResult` to `analyze`, deleting deprecated members, and raising the Java or Maven floor. Those belong to #322 and the 2.0 major release. ## Verification - Run the analyzer unit tests and `mvn -Prun-its verify` on Java 8, 17, and 21. - Build the modified analyzer locally and run `maven-dependency-plugin`'s unit tests and `dependency:analyze` integration tests against that snapshot, so that any behavior change in the consumer becomes visible before release. - Use pilot bytecode dependency analysis to confirm no dependency surface changes. PRs made under this issue are separate, one concern each, and link back here. PR #322 stays draft until this work and the consumer migration are planned. -- 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]
