Table of Content

Few tips for ant installation on win7.

1) download ant binary

from
http://www.apache.org/dist/ant/binaries/

unzip binary to local apache-ant-1.8.4 folder.

2) setup ant run env

ANT_HOME:
C:\apache-ant-1.8.4

add to PATH:
%ANT_HOME%/bin

open new terminal, verify ant version:

cd %ANT_HOME%
ant -version 
Apache Ant(TM) version 1.8.4 compiled on May 22 2012

3) setup needed ant library

setup proxy for ant:
ANT_OPTS:
-Dhttp.proxyHost= -Dhttp.proxyPort=8080

open another new terminal:
ant -f fetch.xml -Ddest=system

error pointing to jspc and jai

Got below error pointing to jspc and jai,

jspc:
[artifact:dependencies] Downloading: tomcat/jasper-compiler/4.1.36/jasper-compiler-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository remote (http://repo1.maven.org/maven2/)
[artifact:dependencies] Downloading: tomcat/jasper-compiler/4.1.36/jasper-compiler-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
[artifact:dependencies] Downloading: tomcat/jasper-runtime/4.1.36/jasper-runtime-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository remote (http://repo1.maven.org/maven2/)
[artifact:dependencies] Downloading: tomcat/jasper-runtime/4.1.36/jasper-runtime-4.1.36.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)

jai:
[artifact:dependencies] Downloading: com/sun/media/jai-codec/1.1.3/jai-codec-1.1.3.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository remote (https://repository.jboss.org/nexus/content/groups/public/)
[artifact:dependencies] Downloading: com/sun/media/jai-codec/1.1.3/jai-codec-1.1.3.pom
[artifact:dependencies] [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
[artifact:dependencies] Downloading: com/sun/media/jai-codec/1.1.3/jai-codec-1.1.3.jar
[artifact:dependencies] [WARNING] Unable to get resource from repository remote (https://repository.jboss.org/nexus/content/groups/public/)
[artifact:dependencies] Downloading: com/sun/media/jai-codec/1.1.3/jai-codec-1.1.3.jar
[artifact:dependencies] [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
[artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
[artifact:dependencies]  Diagnosis:
[artifact:dependencies]
[artifact:dependencies] Unable to resolve artifact: required artifacts missing:
[artifact:dependencies]   com.sun.media:jai-codec:jar:1.1.3
[artifact:dependencies]
[artifact:dependencies] for the artifact:
[artifact:dependencies]   unspecified:unspecified:jar:0.0
[artifact:dependencies]
[artifact:dependencies] from the specified remote repositories:
[artifact:dependencies]   remote (https://repository.jboss.org/nexus/content/groups/public/),
[artifact:dependencies]   central (http://repo1.maven.org/maven2)
[artifact:dependencies]
[artifact:dependencies]

BUILD FAILED
C:\oldhorse\apache-ant-1.8.4\fetch.xml:318: The following error occurred while executing this line:
C:\oldhorse\apache-ant-1.8.4\fetch.xml:116: Unable to resolve artifact: required artifacts missing:
  com.sun.media:jai-codec:jar:1.1.3

for the artifact:
  unspecified:unspecified:jar:0.0

from the specified remote repositories:
  remote (https://repository.jboss.org/nexus/content/groups/public/),
  central (http://repo1.maven.org/maven2)

Total time: 2 seconds

cause and remedy

The reason is that jar lib repository address is not valid in ant config file:

lib/libraries.properties

comment out invalid address and update valid one:

#m2.url=m2.repo=http://repo1.maven.org/maven2/
m2.url=http://mirrors.ibiblio.org/pub/mirrors/maven2

#m2.repo=http://repo1.maven.org/maven2/
m2.repo=http://maven.ala.org.au/repository

fetch.xml 

change jai-core, jai-codec repository from:

    repository="https://repository.jboss.org/nexus/content/groups/public/"

to:

    repository="http://maven.ala.org.au/repository"

conclusion

after above workaround, most of ant lib download and installed but tomcat/jasper-compiler/4.1.36/jasper-compiler-4.1.36.pom still not found, checked all repository, in fact it is not included in ant 1.8.4 build, guess this is the reason.