You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tres Finocchiaro (Jira)" <ji...@apache.org> on 2021/07/30 22:53:00 UTC

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

Tres Finocchiaro created MANTRUN-231:
----------------------------------------

             Summary: 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
         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.

Attached is a simple unit test showing the problem.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)