I am trying to exec git describe in ant from inside eclipse. I have the following inside one of my targets:
<exec executable="git" outputproperty="git-desc">
<arg value="describe"/>
</exec>
When I try this from command line, ant runs properly as it uses the PATH set by my shell. When I try to run ant from eclipse, I get the following error:
Cannot run program "git": error=2, No such file or directory
It seems pretty clear that I need to update the PATH that eclipse is given. How do I go about doing this?
I actually figured this one out on my own. You have to set the PATH environment variable for ant in eclipse.
Step 1: Go to Run->External Tools->External Tools Configurations...
Step 2: Select the ant file you want to run that is trying to execute a command line program
Step 3: Click the Environment tab
Step 4: Click the New button to add a new variable
Step 5: Create a variable named PATH and enter in the paths that you want delimited by :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With