You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Elliotte Rusty Harold (Jira)" <ji...@apache.org> on 2024/11/28 20:36:00 UTC

[jira] [Closed] (MANTRUN-231) exportAntProperties ignored when using antfile

     [ https://issues.apache.org/jira/browse/MANTRUN-231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elliotte Rusty Harold closed MANTRUN-231.
-----------------------------------------

> exportAntProperties ignored when using antfile
> ----------------------------------------------
>
>                 Key: MANTRUN-231
>                 URL: https://issues.apache.org/jira/browse/MANTRUN-231
>             Project: Maven Antrun Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>         Environment: OpenJDK: 16.0.1
> Maven: 3.8.1
> antrun: 3.0.0 
>            Reporter: Tres Finocchiaro
>            Assignee: Elliotte Rusty Harold
>            Priority: Minor
>         Attachments: build.xml, pom.xml
>
>
> {{exportAntProperties}} is honored when using in-line targets, but ignored when using external files.
> Per main page, external files are encouraged, quoting:
> {quote}> "[...] it's encouraged to move all your Ant tasks to a {{build.xml}} file and just call it from the POM using Ant's {{<ant/>}} task."
> {quote}
> ... 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)