"Ant all" doesn't work for me

I participated in the project. This project uses ant, which is not comfortable for me. I checked the source code and tried to run ant in the external directory itself.

Running 'ant' on the command line takes 1 second and I get a BUILD SUCCESFULL message. If I run 'ant all', I get

BUILD FAILED. Java.io.IOExceptio: Cannot run program "ant": CreateProcess=2, the system cannot find the file specifiedand then a long stack.

Most project users run OS-X when I use Windows XP.

Any help or information is appreciated :)

EDIT:

<target name="-all-submodules">     
        <subantlight target="all">
            <filelist refid="ordered_build_files"/>
        </subantlight>
</target>

In another xml file

<macrodef name="subantlight">
        <attribute name="target"/>
        <element name="files" optional="no" implicit="true" description="Filessets/lists of build files"/>
        <sequential>
            <apply executable="ant" failonerror="true">
              <arg value="-f"/>
              <srcfile/>
              <arg value="@{target}"/>
              <files/>
            </apply>
        </sequential>
</macrodef>

This is what an IOException throws when it hits the line with "apply executeable ..".

UPDATED EDIT: If I set the absolute path as follows

<macrodef name="subantlight">
            <attribute name="target"/>
            <element name="files" optional="no" implicit="true" description="Filessets/lists of build files"/>
            <sequential>
                <apply executable="MyAbsolutePathHereToAnt.bat" failonerror="true">
                  <arg value="-f"/>
                  <srcfile/>
                  <arg value="@{target}"/>
                  <files/>
                </apply>
            </sequential>
    </macrodef>

Everything is working.

ANT_HOME ant. JAVA_HOME Java JDK. PATH % ANT_HOME%\bin;% JAVA_HOME%\bin

echo% ANT_HOME% .

, .

+3
2

ant build.xml . 'ant all' "all" .

- ant - - ? , "" , "" , ant. .

, <ant> <target> . - / <ant> .

build.xml -

<project name="Name" default="compile" basedir="/src">

'default' . , ( ant 1.6), .

" ", " " . ant script (, "env.JAVA_HOME" ..) . , .

+4

bin Ant PATH? , .

, all Ant (), .

+1

Source: https://habr.com/ru/post/1747182/


All Articles