I'm trying to install Ant on Windows 7 using these instructions, but at stage 5, when I run the command ant -f fetch.xml -Ddest=system
, I get the following error:
Buildfile: C:\Program Files\WinAnt\fetch.xml
pick-dest:
[echo] Downloading to C:\Program Files\WinAnt\lib
probe-m2:
download-m2:
[echo] Downloading to C:\Program Files\WinAnt\lib
[get] Getting: http://ibiblio.org/maven2//org/apache/maven/maven-artifact-ant/2.0. /maven-artifact-ant-2.0.4-dep.jar
[get] To: C:\Program Files\WinAnt\lib\maven-artifact-ant-2.0.4-dep.jar
[get] Error opening connection java.io.FileNotFoundException: http://ibiblio.org/maven2//org/apache/maven/maven-artifact-ant/2.0.4/maven-artifact-ant-2.0.4-dep.jar
[get] Error opening connection java.io.FileNotFoundException: http://ibiblio.org/maven2//org/apache/maven/maven-artifact-ant/2.0.4/maven-artifact-ant-2.0.4-dep.jar
[get] Error opening connection java.io.FileNotFoundException: http://ibiblio.org/maven2//org/apache/maven/maven-artifact-ant/2.0.4/maven-artifact-ant-2.0.4-dep.jar
[get] Can't get http://ibiblio.org/maven2//org/apache/maven/maven-artifact-ant/2.0.4/maven-artifact-ant-2.0.4-dep.jar to C:\Program Files\WinAnt\lib\maven-artifact-ant-2.0.4-dep.jar
BUILD FAILED
C:\Program Files\WinAnt\get-m2.xml:85: Can't get http://ibiblio.org/maven2//org/apach/maven/maven-artifact-ant/2.0.4/maven-artifact-ant-2.0.4-dep.jar to C:\Program Files\WinAnt\lib\maven-artifact-ant-2.0.4-dep.jar
Total time: 1 second
I understand that the URL is not reachable, so I tried to enter this URL into my browser, and indeed it does not exist. I found the file maven-artifact-ant-2.0.4-dep.jar
at:
http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/maven/maven-artifact-ant/2.0.4/maven-artifact-ant-2.0.4-dep.jar
instead. So how can I fix this problem?
Just need to update the m2.url property in the lib/library.properties file to http://mirrors.ibiblio.org/pub/mirrors/maven2.
Run ANT as follows
$ ant -f $ANT_HOME/fetch.xml -Ddest=user -Dm2.url=http://repo1.maven.org/maven2
The m2.url property needs to be overloaded. The following property file in ANT needs to be updated:
$ANT_HOME/lib/libraries.properties
Using a now deprecated Maven Central URL
The URL is correct, but you're trying to download the files into a subfolder of Program Files
(C:\Program Files\WinAnt\lib). To do so you need to be running your commands with Administrator rights.
So right click on your Command Prompt shortcut and select "run as administrator
" or enter "cmd
" into the search field of the start menu and press CTRL + SHIFT + ENTER.
Then try to run the ant command again:
ant -f fetch.xml -Ddest=system
And if you have trouble downloading any other files using the script, it seems to work well to just download them using your browser, put them in the right place, and then edit fetch.xml
to not download the file.
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