You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/10/19 09:01:52 UTC
[PR] refactor: replace plexus-archiver with JDK jar tool, use maven-archiver for manifest [maven-source-plugin]
gnodet opened a new pull request, #341:
URL: https://github.com/apache/maven-source-plugin/pull/341
## Summary
Migrates maven-source-plugin away from `plexus-archiver` and `maven-archiver`'s `createArchive()` to use the JDK built-in `jar` tool for archive creation, while keeping `maven-archiver` for manifest generation only.
## Changes
### New classes
- **`SourceFileCollector`**: walks source directories with `Files.walkFileTree()`, applies include/exclude glob patterns, handles default SCM excludes (replaces plexus `DefaultFileSet`).
- **`SourceToolExecutor`**: invokes `ToolProvider.findFirst("jar")` via a staging directory approach. Supports `--date` for reproducible builds (JDK 19+). Uses `MavenArchiver.parseBuildOutputTimestamp()` for timestamp parsing.
### Modified
- **`AbstractSourceJarMojo`**: removed `JarArchiver` injection and all plexus archiver usage. New flow: collect files → build manifest with `MavenArchiver.getManifest()` → create JAR with `SourceToolExecutor`. Generates maven descriptor (pom.xml + pom.properties) inline.
- **`pom.xml`**: removed `plexus-archiver` and `plexus-utils` dependencies, bumped `maven-archiver` to `4.0.0-beta-7-SNAPSHOT`.
### Deleted
- **`Archivers.java`**: provided `JarArchiver` via DI — no longer needed.
## Motivation
Depends on apache/maven-archiver#422 which strips `plexus-archiver` from maven-archiver itself. The sources JAR is structurally simpler than the JAR plugin (no MR-JAR, no JPMS module hierarchy, no classpath) so the JDK `jar` tool invocation is straightforward.
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org