Ant can't find a executable in the Windows pat

2019-07-07 13:08发布

I got a simple ant target :

<target name="doxygen">
    <exec executable="doxygen" dir="${basedir}/doxygen">
        <arg value="Doxyfile" />
    </exec>
</target>

I'm on Windows Seven. When i try the same command line ( doxygen Doxyfile ) in the Windows console, it works perfectly. The doxygen executable can by found because i added the good path in my PATH environment variable.

But ANT juste can't find the doxygen executable and i get the following error :

build.xml:83: Execute failed: java.io.IOException: Cannot run program "doxygen.exe" : CreateProcess error=2

How can i make ANT to use the Windows PATH environment variable ?

I already tried the searchpath property, but i don't works.

1条回答
时光不老,我们不散
2楼-- · 2019-07-07 13:37

You want to find where Doxygen is currently installed on your system. Then make a property with that value, so it can be overridden by people that installed doxygen somewhere else.

<property name="doxygen.path" location="C:\Program Files\Doxygen"/>

<target name="doxygen">
    <exec executable="${doxygen.path}/doxygen" dir="${basedir}/doxygen">
        <arg value="Doxyfile" />
    </exec>
</target>
查看更多
登录 后发表回答