[Bug 26453] Exec task displays 'error' mesage "Result: XX"

2023-12-22 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=26453

Chris Fairman  changed:

   What|Removed |Added

   Severity|enhancement |minor
Version|unspecified |1.10.14

--- Comment #3 from Chris Fairman  ---
---
Verbose output:
---
F:\Testing> ant -v -buildfile test.xml return_nonzero
Apache Ant(TM) version 1.10.14 compiled on August 16 2023
Buildfile: F:\test.xml
Detected Java version: 17 in: F:\Java
Detected OS: Windows Server 2022
parsing buildfile F:\test.xml with URI = file:/F:/test.xml
Project base dir set to: F:\
Build sequence for target(s) `return_nonzero' is [return_nonzero]
Complete build sequence is [return_nonzero, return_zero, ]

return_nonzero:
parsing buildfile
jar:file:/F:/apache-ant-1.10.14/lib/ant.jar!/org/apache/tools/ant/antlib.xml
with URI =
jar:file:/F:/apache-ant-1.10.14/lib/ant.jar!/org/apache/tools/ant/antlib.xml
from a zip file
 [exec] Current OS is Windows Server 2022
 [exec] Discarding output
 [exec] Discarding error output
 [exec] Executing 'cmd' with arguments:
 [exec] '/c'
 [exec] 'exit 1'
 [exec]
 [exec] The ' characters around the executable and arguments are
 [exec] not part of the command.
 [exec] Result: 1

BUILD SUCCESSFUL
Total time: 0 seconds

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 26453] Exec task displays 'error' mesage "Result: XX"

2023-12-22 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=26453

--- Comment #2 from Chris Fairman  ---
Ultimately the issue is that if a non-zero return value is encountered (even
when expected) it isn't possible to avoid the following output even when
"discardOutput" and/or "discardError" is set:
[exec] Result: 1
- or -
[exec] Result: 

As use case for expected non-zero return values on Windows, findstr returns 0
if a string is found, non-zero if not.

We use a for loop to check the state of a TomEE service that can take a
while to stop:


 


If a service is not in a stopped state yet ( i.e: STOPPING ), ${result}
is populated as expected, however "[exec] Result: 1" is displayed despite
efforts to avoid output.

test.xml:






 






 






---
Return Zero
---
F:\> ant -buildfile test.xml return_zero
Buildfile: F:\test.xml

return_zero:

BUILD SUCCESSFUL
Total time: 0 seconds


---
Return NonZero
---
F:\> ant -buildfile test.xml return_nonzero
Buildfile: F:\test.xml

return_nonzero:
 [exec] Result: 1

BUILD SUCCESSFUL
Total time: 0 seconds

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 26453] Exec task displays 'error' mesage "Result: XX"

2023-12-22 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=26453

Chris Fairman  changed:

   What|Removed |Added

 CC||chris.fairman@ballaerospace
   ||.com

-- 
You are receiving this mail because:
You are the assignee for the bug.