Add integration test for multi-release JAR detection#563
Open
elharo wants to merge 2 commits into
Open
Conversation
Adds an integration test that verifies the Multi-Release: true manifest entry is present when META-INF/versions/ files exist in the class output. This test passes on Linux/macOS but fails on Windows due to File.separatorChar mismatch (the prefix check uses backslash on Windows but FileSetManager always returns forward-slash paths). Issue: apache#557
elharo
marked this pull request as draft
July 20, 2026 10:14
elharo
marked this pull request as ready for review
July 20, 2026 10:26
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds a Maven Invoker integration test to validate that the built JAR is marked as multi-release (Multi-Release: true) when META-INF/versions/ content is present, improving cross-platform confidence (including Windows).
Changes:
- Added a new Maven Invoker IT project (
MJAR-557-detect-mjar) that packagesMETA-INF/versions/9/...content. - Added a
verify.groovyscript to assertMulti-Releasemanifest attribute is set totrue. - Updated root
pom.xmlexcludes to avoid RAT/header checks on the added plain text fixture.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/it/MJAR-557-detect-mjar/verify.groovy | Verifies the built JAR manifest contains Multi-Release: true. |
| src/it/MJAR-557-detect-mjar/src/main/resources/META-INF/versions/9/test.txt | Adds a META-INF/versions/9/ fixture to trigger MRJAR detection. |
| src/it/MJAR-557-detect-mjar/pom.xml | Defines the IT Maven project that builds a JAR using the plugin under test. |
| src/it/MJAR-557-detect-mjar/invoker.properties | Configures Invoker execution constraints and test description. |
| pom.xml | Excludes the fixture text file from checks (e.g., RAT/license header validation). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+26
to
+29
| def mrjar = new JarFile(jarFile) | ||
| def manifest = mrjar.manifest.mainAttributes | ||
|
|
||
| assert manifest.getValue(Attributes.Name.MULTI_RELEASE) == "true" |
| def mrjar = new JarFile(jarFile) | ||
| def manifest = mrjar.manifest.mainAttributes | ||
|
|
||
| assert manifest.getValue(Attributes.Name.MULTI_RELEASE) == "true" |
| @@ -0,0 +1 @@ | |||
| Test file for multi-release JAR detection | |||
Contributor
Author
|
Addressed Copilot review comments:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an integration test that verifies the
Multi-Release: truemanifest entry is added when the class output containsMETA-INF/versions/files.The detection logic in
AbstractJarMojousesFile.separatorCharto build the path prefix, which matches the platform separator used byDirectoryScanner. This test passes on all platforms (Linux, macOS, Windows).