ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50506] New: Ant Exec task is not failing in windows while running bat file
Date Tue, 21 Dec 2010 13:29:15 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50506

           Summary: Ant Exec task is not failing in windows while running
                    bat file
           Product: Ant
           Version: 1.8.1
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: major
          Priority: P2
         Component: AntUnit
        AssignedTo: notifications@ant.apache.org
        ReportedBy: y.nagaraj.mca07@gmail.com


I had a windows batch file and it contains :
build.bat :
  cls
  ant -f build.xml


test.xml :

<project name="test" default="run">
<target name="run">
        <exec executable="cmd.exe" failonerror="true" osfamily="windows" >
                <arg line="/c build.bat" />
        </exec>
        <echo message="test" />
</target>
</project>

the below is the output, when I run ant -f test.xml :

Buildfile: E:\Test\test.xml

run:
     [exec]
     [exec] E:\Test>cls
     [exec] ?
     [exec] E:\Test>ant -f build.xml
     [exec] Buildfile: E:\Test\build.xml
     [exec]
     [exec] init:
     [exec]
     [exec] clean_all:
     [exec]    [delete] Deleting directory E:\Test\target
     [exec]     [mkdir] Created dir: E:\Test\target
     [exec]
     [exec] prepareTobuild:
     [exec]     [mkdir] Created dir: E:\Test\target\lib
     [exec]     [mkdir] Created dir: E:\Test\target\classes
     [exec]     [mkdir] Created dir: E:\Test\target\classes\resources
     [exec]     [mkdir] Created dir: E:\Test\target\samples
     [exec]     [mkdir] Created dir: E:\Test\target\samples\src
     [exec]     [mkdir] Created dir: E:\Test\target\samples\data
     [exec]
     [exec] out_genjaxb:
     [exec]      [echo] Compiling the schema...
     [exec]       [xjc] Compiling file:/E:/Test/build/test.xsd
     [exec]
     [exec] BUILD FAILED
     [exec] E:\Test\build.xml:1
84: java.lang.NoClassDefFoundError: javax.xml.bind.Element
     [exec]     at
com.sun.tools.xjc.reader.xmlschema.cs.DefaultClassBinder.clas
s$(DefaultClassBinder.java:112)
     [exec]     at
com.sun.tools.xjc.reader.xmlschema.cs.DefaultClassBinder.elem
entDecl(DefaultClassBinder.java:112)
     [exec]     at
com.sun.xml.xsom.impl.ElementDecl.apply(ElementDecl.java:182)

     [exec]     at
com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector._bindToCl
ass(ClassSelector.java:219)
     [exec]     at
com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector.bindToTyp
e(ClassSelector.java:184)
     [exec]     at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.populate(BGMBui
lder.java:264)
     [exec]     at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.buildContents(B
GMBuilder.java:231)
     [exec]     at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuild
er.java:120)
     [exec]     at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilde
r.java:84)
     [exec]     at
com.sun.tools.xjc.GrammarLoader.annotateXMLSchema(GrammarLoad
er.java:408)
     [exec]     at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:127)
     [exec]     at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:76)
     [exec]     at com.sun.tools.xjc.XJCTask._doXJC(XJCTask.java:356)
     [exec]     at com.sun.tools.xjc.XJCTask.doXJC(XJCTask.java:305)
     [exec]     at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:245)
     [exec]     at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:291)
     [exec]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
     [exec]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
     [exec]     at java.lang.reflect.Method.invoke(Method.java:585)
     [exec]     at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchU
tils.java:106)
     [exec]     at org.apache.tools.ant.Task.perform(Task.java:348)
     [exec]     at org.apache.tools.ant.Target.execute(Target.java:390)
     [exec]     at org.apache.tools.ant.Target.performTasks(Target.java:411)
     [exec]     at
org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1397)
     [exec]     at
org.apache.tools.ant.Project.executeTarget(Project.java:1366)

     [exec]     at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.java:41)
     [exec]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1249
)
     [exec]     at org.apache.tools.ant.Main.runBuild(Main.java:801)
     [exec]     at org.apache.tools.ant.Main.startAnt(Main.java:218)
     [exec]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
     [exec]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
     [exec]
     [exec] Total time: 1 second
     [exec]
     [echo] test

BUILD SUCCESSFUL
Total time: 1 second

The exec task and build has to fail since the build.bat execution fails.
But, the same is not happening, instead build and exec task is passing.

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

Mime
View raw message