This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 198605 - Ant java task with redirector does not work
Summary: Ant java task with redirector does not work
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 7.0
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-14 12:32 UTC by racy
Modified: 2016-07-07 08:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description racy 2011-05-14 12:32:41 UTC
I have the following code in a build.xml. It is supposed to redirect the output from the VersionAnt class to the specified output property. It does not do that, but instead outputs the text to the screen. I have tried with the attribute fork="true" as well, but that does not make any difference.

In Netbeans 6.9.1 this worked with the fork attribute set, but in some older versions it did not work at all just as it is now in 7.0. I would say that this is a regression.

<java classname="test.VersionAnt" classpath="build/classes">
  <redirector outputproperty="version"/>
</java>
<java classname="test.VersionAnt" classpath="build/classes">
  <arg value="underscore"/>
  <redirector outputproperty="version.underscore"/>
</java>
Comment 1 Jesse Glick 2011-05-23 23:05:39 UTC
Confirmed with:

<project>
    <target name="run">
        <echo file="C.java">public class C {public static void main(String[] x) {System.out.println("1.2");}}</echo>
        <javac srcdir="." destdir="." includes="C.java"/>
        <java classname="C" classpath=".">
            <redirector outputproperty="version"/>
        </java>
        <echo>version=${version}</echo>
    </target>
</project>
Comment 2 Martin Balin 2016-07-07 08:38:35 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss