slachiewicz opened a new pull request, #1016:
URL: https://github.com/apache/maven-enforcer/pull/1016

   `ArtifactStubFactory` was the only `maven-plugin-testing-harness` class the 
test tree used. It carries an `ArchiverManager` field and a 
`createUnpackableFile` declaring `NoSuchArchiverException`, so 
`plexus-archiver` had to be on the test classpath for the JVM to resolve types 
no test calls — the tests only ever ask for `getReleaseArtifact`, 
`getSnapshotArtifact`, `getScopedArtifacts`, `getTypedArtifacts` and 
`createArtifact`. Dropping it outright gives 36 `NoClassDefFoundError`s across 
6 classes.
   
   A ~90-line local factory replaces it, so both test dependencies go. Call 
sites are unchanged apart from the import.
   
   Equivalence was checked before the swap with a throwaway test comparing 21 
properties of every artifact both factories produce — coordinates, version 
range, scope, type, classifier, `hasClassifier`, optional, release/snapshot, 
id, dependency conflict id, file, and the handler's extension, packaging, 
directory, language, `addedToClasspath` and `includesDependencies`. All 
identical but one: the *handler's* classifier is `null` rather than `""`. The 
artifact's own classifier and `hasClassifier()` are unchanged, and nothing 
reads the handler's.
   
   Verified: `mvn verify -DskipITs` → BUILD SUCCESS, 260/260 in enforcer-rules, 
spotless and RAT green. The test classpath loses 7 jars and 8.8 MB — zstd-jni 
(7.2M), commons-compress (1.1M), plexus-archiver, plexus-io, xz, the harness 
and plexus-testing.
   
   Makes #1015 moot.
   
   *This change was created with AI assistance.*


-- 
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]

Reply via email to