You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "efegokdemir (via GitHub)" <gi...@apache.org> on 2026/09/23 15:42:40 UTC
[PR] Handle archive paths when removing outdated resources [maven-ear-plugin]
efegokdemir opened a new pull request, #559:
URL: https://github.com/apache/maven-ear-plugin/pull/559
## Summary
Fixes #518 by making outdated-resource cleanup work when a destination path comes from a different file-system provider, such as a ZIP file system.
## Changes
- Convert an absolute fallback path to a path relative to its provider root before looking it up in the relative outdated-resource collection.
- Add a regression test using a ZIP file system destination.
## Testing
- `JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn -Dtest=EarMojoTest test` — PASS (4 tests)
- `JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn -Prun-its verify` — PASS (49 unit tests, 103 integration tests, 18 Invoker projects)
- `git diff --check` — PASS
## Notes
- Issue #518 was open and unassigned at final duplicate check.
- I searched open pull requests for issue #518 and the outdated-resource fallback; no overlapping PR was found.
- AI assistance was used during investigation and implementation. The changed lines and test results were reviewed manually.
- The commit is DCO signed and SSH signed.
--
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
Re: [PR] Handle archive paths when removing outdated resources [maven-ear-plugin]
Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on code in PR #559:
URL: https://github.com/apache/maven-ear-plugin/pull/559#discussion_r4360117507
##########
src/test/java/org/apache/maven/plugins/ear/EarMojoTest.java:
##########
@@ -54,4 +64,29 @@ void testGetEarFileWithDashPrefixedClassifier() throws Exception {
File result = invokeGetEarFile("myapp", "-sources");
assertEquals(new File(tempDir, "myapp-sources.ear"), result);
}
+
+ @Test
+ void testRemoveFromOutdatedResourcesWithDifferentFileSystemProvider() throws Exception {
+ EarMojo mojo = new EarMojo(null, null, null, null, null, null);
+ Field workDirectory = AbstractEarMojo.class.getDeclaredField("workDirectory");
Review Comment:
never use reflection
--
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
Re: [PR] Handle archive paths when removing outdated resources [maven-ear-plugin]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #559:
URL: https://github.com/apache/maven-ear-plugin/pull/559#discussion_r4360271973
##########
src/test/java/org/apache/maven/plugins/ear/EarMojoTest.java:
##########
@@ -54,4 +64,29 @@ void testGetEarFileWithDashPrefixedClassifier() throws Exception {
File result = invokeGetEarFile("myapp", "-sources");
assertEquals(new File(tempDir, "myapp-sources.ear"), result);
}
+
+ @Test
+ void testRemoveFromOutdatedResourcesWithDifferentFileSystemProvider() throws Exception {
+ EarMojo mojo = new EarMojo(null, null, null, null, null, null);
+ Field workDirectory = AbstractEarMojo.class.getDeclaredField("workDirectory");
+ workDirectory.setAccessible(true);
+ workDirectory.set(mojo, tempDir);
+
+ Path archive = tempDir.toPath().resolve("module.war");
+ try (ZipOutputStream ignored = new ZipOutputStream(Files.newOutputStream(archive))) {
+ // Create an empty archive before mounting it as a file system.
+ }
+
+ try (FileSystem archiveFileSystem = FileSystems.newFileSystem(archive, null)) {
Review Comment:
`FileSystems.newFileSystem(Path, null)` is brittle because newer JDKs expose multiple overloads (`(Path, Map)` and `(Path, ClassLoader)`), and an untyped `null` can become ambiguous depending on compile configuration. Prefer selecting the overload explicitly (e.g., cast `null` to `ClassLoader`) to keep the test compiling reliably across JDK/toolchain changes.
--
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
Re: [PR] Handle archive paths when removing outdated resources [maven-ear-plugin]
Posted by "github-actions[bot] (via GitHub) via issues" <is...@maven.apache.org>.
github-actions[bot] commented on PR #559:
URL: https://github.com/apache/maven-ear-plugin/pull/559#issuecomment-7106830901
<!-- license-declaration-check -->
### ⚠️ License declaration missing
The pull request description must contain at least one of the following lines with a **checked** box (`[x]`):
```markdown
- [ ] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
- [ ] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
```
This comment will be hidden automatically once the description is fixed.
--
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