function prepare_env () {
# install java1.7
yum install java-1.7.0-openjdk-devel -y
echo "PATH=/usr/lib/jvm/java-1.7.0/:$PATH">> ~/.bash_profile
# install maven, prepare mvn repository, use oschinato mirror central.
if [ ! -f apache-maven-3.3.3-bin.tar.gz ]; then
wget http://scm.qiyi.virtual/tigase-devel/awesome-configs/raw/master/files/apache-maven-3.3.3-bin.tar.gz
#wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
tar -xzf apache-maven-3.3.3-bin.tar.gz
echo"PATH=`pwd`/apache-maven-3.3.3/bin:$PATH" >> ~/.bash_profile
fi
# change the setting.xml
if [ ! -d ~/.m2 ]; then
mkdir ~/.m2
fi
wget http://scm.qiyi.virtual/tigase-devel/awesome-configs/raw/master/mvnmirror/settings.xml.oschina -O ~/.m2/settings.xml
# prepare git
if [ ! -f /etc/yum.repos.d/devtools-2.repo ]; then
wget http://people.centos.org/tru/devtools-2/devtools-2.repo-O /etc/yum.repos.d/devtools-2.repo
echo 'source/opt/rh/devtoolset-2/enable' >> ~/.bash_profile
yum install devtoolset-2-git-all -y
fi
echo "export PATH" >>~/.bash_profile
source ~/.bash_profile
}