elharo opened a new pull request, #174:
URL: https://github.com/apache/maven-resolver-ant-tasks/pull/174
Fixes #169
## Problem
`CreatePom.execute()` threw a `NullPointerException` when `pomTarget` was a
bare relative filename such as `pom.xml`. For such a value `new
File("pom.xml").getParentFile()` returns `null`, so the parent-dir check failed.
## Fix
Resolve a bare `pomTarget` against the Ant project base dir before creating
the parent directory. The POM is now written to `${basedir}/pom.xml`, matching
the expected behavior of writing to the current working directory / project
base dir. Targets with a directory component (e.g. `out/pom.xml`) behave as
before.
## Test
New `CreatePomNoParentDirTest` unit test reproduces the crash: it runs the
task with `pomTarget="pom.xml"` and a project base dir, and asserts the POM is
written to `${basedir}/pom.xml`. Before the fix it fails with the NPE above;
after the fix it passes.
All 55 tests pass (`mvn verify`).
--
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]