You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2009/07/29 20:46:07 UTC

DO NOT REPLY [Bug 47602] New: Java task outputproperty attribute stopped working in version 1.7.1

https://issues.apache.org/bugzilla/show_bug.cgi?id=47602

           Summary: Java task outputproperty attribute stopped working in
                    version 1.7.1
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: ddixon@arescorporation.com


Using a compiled java class very much like this:

public class ExampleClass{

    public static void main(String[] args){
    System.out.println("Sample Message");
    }
}

The following worked in a previous version of ant

        <java fork="false" 
              classname="ExampleClass" 
              outputproperty="outputstring">
            <arg line="test_arg" />
            <classpath refid="classpath.path" />
        </java>
    <echo message="outputstring=${outputstring}"/>

No output to console other than the echo 

    outputstring=Sample Message

With ant 1.7.1

    outputstring=

(Note: it's blank, not "outputstring=${outputstring}" which it would be were
outputstring not assigned)

If I change the java to:

public class ExampleClass{

    public static void main(String[] args){
    System.out.println("Sample Message");
    System.err.println("Sample Message");
    }
}

and change the ant target to:

        <java fork="false" 
              classname="ExampleClass" 
              outputproperty="outputstring"
              errorproperty="errorstring">
            <arg line="test_arg" />
            <classpath refid="classpath.path" />
        </java>
    <echo message="outputstring=${outputstring}"/>
    <echo message="errorstring=${errorstring}"/>

I get this:

   outputstring=
   errorstring=Sample Message

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 47602] Java task outputproperty attribute stopped working in version 1.7.1

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47602


Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME




--- Comment #2 from Stefan Bodewig <bo...@apache.org>  2009-07-30 05:45:13 PST ---
svn revision 799251 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=799251 ) contains an AntUnit test for your scenario and it passes.

Just to be sure I ran the test for Ant 1.7.1 in addition to svn trunk and it
passes there as well.

Could it be that anything else in your build file is setting the property to an
empty string before your java task is run?  <java> won't override existing
properties.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 47602] Java task outputproperty attribute stopped working in version 1.7.1

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47602





--- Comment #1 from Dave Dixon <dd...@arescorporation.com>  2009-07-29 12:29:27 PST ---
Using netbeans 6.7 and java 1.6_14-b08

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.