slachiewicz commented on issue #13302:
URL: https://github.com/apache/maven/issues/13302#issuecomment-5913952029
### maven-common-artifact-filters
PR: apache/maven-common-artifact-filters#130. Status: **ported, one feature
removed**, 4.0.0-SNAPSHOT, Java 17.
Verified locally: `mvn verify` with Maven 4.0.0-rc-7, JDK 21 → 231 tests
before, 226 after, 0 failures. Six tests covered the removed `actTransitively`;
one is new. Spotless clean.
**Public API changes**
- `ArtifactFilter` → `Predicate<org.apache.maven.api.Dependency>` in
`Pattern{In,Ex}cludesArtifactFilter`, `Strict*`, `ScopeArtifactFilter` and
`ArtifactIncludeFilterTransformer`.
- `collection.*` filters work on `Set<Dependency>` instead of
`Set<Artifact>`.
- `Pattern{In,Ex}cludesArtifactFilter(Collection, boolean actTransitively)`
removed.
- `ArtifactTransitivityFilter(Artifact, ProjectBuildingRequest,
ProjectBuilder)` → `(Session, Artifact)`, collecting via `TEST_RUNTIME`; this
approximates the old project-build resolution.
- `resolve.Node.getDependency()` returns the immutable
`org.apache.maven.api.model.Dependency`.
- The `EclipseAether*` transformers stay on the resolver API; nothing in
`org.apache.maven.api` models exclusions on a `DependencyFilter`.
**Gaps**
- No dependency trail or parent link on `Artifact`, `Dependency` or `Node`,
so `actTransitively` is removed. This is the largest loss;
maven-assembly-plugin `useTransitiveFiltering` depends on it.
- Version ranges: `VersionParser` is only reachable through a `Session`, and
filters are built without one; the port uses resolver-util
`GenericVersionScheme`.
- `type`, `scope` and `optional` live only on `Dependency`, so every filter
moves from `Artifact` to `Dependency`.
- No public factory for `Dependency`, `Type` or `Version` without a
`Session`; tests and consumers need stubs or Mockito.
- The new scopes (`COMPILE_ONLY`, `TEST_ONLY`, `TEST_RUNTIME`) have no
defined behaviour in `ScopeArtifactFilter`; they are included, like unknown
scopes before.
**Consumers that break (compile):** maven-dependency-plugin,
maven-assembly-plugin, maven-javadoc-plugin (`ResourceResolver`),
maven-project-info-reports-plugin, maven-remote-resources-plugin,
maven-surefire-common.
**Recommendation:** port for 4.0.0 alongside a 3.x line, once a parent-aware
replacement for `actTransitively` is agreed.
--
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]