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

Tres Finocchiaro updated MANTRUN-231:
-------------------------------------
    Description: 
{{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.

An alternative may be to allow injection of the {{<import file=...>}} syntax 
instead, but this is not yet possible currently, since project tags that would 
exist outside of the {{<target>}} are currently prohibited by the plugin.

Attached is a simple unit test showing the problem.

  was:
{{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.

Attached is a simple unit test showing the problem.


> 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
>            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.
> An alternative may be to allow injection of the {{<import file=...>}} syntax 
> instead, but this is not yet possible currently, since project tags that 
> would 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.3.4#803005)

Reply via email to