elharo opened a new pull request, #523:
URL: https://github.com/apache/maven-ear-plugin/pull/523
Closes #510
## Problem
In `ApplicationXmlWriter.write()`, any `IOException` during XML writing
(e.g., disk full, permission denied) is silently swallowed:
\`\`\`java
} catch (IOException ex) {
// ignore
}
\`\`\`
This means the EAR build succeeds with a truncated or missing
`application.xml` deployment descriptor, making the failure undetectable.
## Changes
1. **ApplicationXmlWriter.java**: Replace the empty catch block with a throw
of `EarPluginException` wrapping the `IOException`.
2. **ApplicationXmlWriterTest.java** (new): Unit tests for the writer:
- `testWriteSucceedsToValidFile`: happy path writing to a temp file
- `testWriteThrowsExceptionOnIoError`: writing to `/dev/full` asserts
`EarPluginException` is thrown
## Verification
- Test-first: the new test failed before the fix (exception was silently
swallowed)
- After fix: all 45 tests pass
--
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]