1.一键安装Ant的shell脚本:
#!/bin/bash #apt-get update#apt-get install zip unzipwget -Pwget -P /opt https://coding.net/u/jamesz2011/p/ubuntu_lib1/git/raw/master/ant/apache-ant-1.10.3-bin.zipunzip /opt/apache-ant-1.10.3-bin.zip -d /opt/#set environmentexport ANT_HOME="/opt/apache-ant-1.10.3"if ! grep ANT_HOME="/opt/apache-ant-1.10.3" /etc/profile then echo "ANT_HOME=/opt/apache-ant-1.10.3" | sudo tee -a /etc/profile echo "export ANT_HOME" | sudo tee -a /etc/profile echo "PATH=${ANT_HOME}/bin:$PATH" | sudo tee -a /etc/profile echo "export PATH" | sudo tee -a /etc/profile fisource /etc/profile sudo ln -s /opt/apache-ant-1.10.3/bin/ant /usr/local/bin/antant -versionecho "install ant is ok !!!"
3.用法:
3.1.wget下载shell脚本
#codewget https://coding.net/u/jamesz2011/p/ubuntu_lib1/git/raw/master/ant/install_ant.sh
3.2.chmod赋予“可运行”权限
#codechmod a+x install_ant.sh
3.3.source运行install_ant.sh脚本
#codesource install_ant.sh
4.一键安装Ant成功的标志:
#code#ant -version 验证Ant是否安装配置成功ant -version