Ben's

ant 설치 본문

리눅스

ant 설치

Ben Ko (SINCE 2013) 2013. 1. 17. 17:35
728x90

[ant 설치]

1. 다운로드 받아 압축해제

2. 설치시 문제 발생

[root@test-0158 apache-ant-1.7.0]# ./build.sh -Ddist.dir=/home/ant dist
... Bootstrapping Ant Distribution
... Compiling Ant Classes
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
... Copying Required Files
... Building Ant Distribution
Buildfile: build.xml

bootstrap:

prepare:

...

compile-tests:

test-jar:

BUILD FAILED
/root/src/tmp/apache-ant-1.7.0/build.xml:1105: The following error occurred while executing this line:
/root/src/tmp/apache-ant-1.7.0/build.xml:911: We cannot build the test jar unless JUnit is present,
      as JUnit is needed to compile the test classes.

Total time: 8 seconds
... Failed Building Ant Distribution !
Bootstrap FAILED

3. 문제 해결
   - yum install ant-junit
   - jdk 설치
   - /etc/profile 에 내용 추가

# /etc/profile

export JAVA_HOME=/usr/java/jdk1.6.0_05
export APACHE_HOME=/home/apache
export ANT_HOME=/home/ant
export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/activation.jar:$JAVA_HOME/lib/mail.jar:/usr/share/java/junit.jar
export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin:$APACHE_HOME/bin:.

4. 설치

[root@test-0158 ant]# sh ./build.sh -Ddist.dir=/home/ant dist
... Bootstrapping Ant Distribution
... Compiling Ant Classes
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
... Copying Required Files
... Building Ant Distribution
Buildfile: build.xml

bootstrap:

prepare:

...

dist_javadocs:
    [mkdir] Created dir: /home/ant/docs/manual/api
     [copy] Copying 1180 files to /home/ant/docs/manual/api

internal_dist:
    [mkdir] Created dir: /home/ant/etc
     [copy] Copying 25 files to /home/ant/lib
     [copy] Copying 1 file to /home/ant/lib
     [copy] Copying 15 files to /home/ant/etc

BUILD SUCCESSFUL
Total time: 38 seconds

[root@test-0158 apache-ant-1.7.0]# ./build.sh install
Buildfile: build.xml

install:

prepare:

check_for_optional_packages:

build:

...

internal_dist:
    [mkdir] Created dir: /home/ant/etc
     [copy] Copying 1 file to /home/ant/lib
     [copy] Copying 1 file to /home/ant/lib
     [copy] Copying 25 files to /home/ant/lib
     [copy] Copying 1 file to /home/ant/lib
     [copy] Copying 259 files to /home/ant/docs
     [copy] Copying 33 files to /home/ant/docs
     [copy] Copying 11 files to /home/ant
     [copy] Copying 15 files to /home/ant/etc

BUILD SUCCESSFUL
Total time: 25 seconds

5. 참고문서

http://ant.apache.org/manual/install.html#optionalTasks