-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Tres Finocchiaro opened MANTRUN-231 and commented
exportAntProperties is honored when using in-line targets, but ignored when using external files.
Per main page, external files are encouraged, quoting:
"[...] it's encouraged to move all your Ant tasks to a
build.xmlfile and just call it from the POM using Ant's<ant/>task."
... however this is a severe degradation in usefulness unless there's a way to retrieve these properties.
Investigation shows this may be by-design from ant itself. This scenario was summarized and simplified for StackOverflow here: https://stackoverflow.com/questions/68597705
Investigation shows that targets which use antfile are incapable of obtaining properties set by those antfiles.
Although this behavior has been this way for a long time by ant (and thus NOT a bug), I believe the existing behavior is a bug, or at the very least, the "encouraged" keyword should be removed, or disclaimed as to the impact this may have on projects which utilize this.
If this is considered to NOT be a bug, I would ask that this bug report is switched to an enhancement request instead, as the original encouragement encourages code separation which helps project organization, but of which can't make use of the exportAntProperties property while this behavior exists.
A workaround may be to allow injection of the <import file=...> syntax instead using inlining, but this is not yet possible currently, since project tags that exist outside of the <target> are currently prohibited by the plugin.
Attached is a simple unit test showing the problem.
Affects: 3.0.0
Attachments:
Remote Links: