-
Notifications
You must be signed in to change notification settings - Fork 24
/
ant_ivy_bootstrap.sh
executable file
·54 lines (43 loc) · 2.36 KB
/
ant_ivy_bootstrap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash -e
bs_home="$HOME/.ant/bootstrap"
ant_version="1.10.9"
ivy_version="2.5.0"
ant_file="apache-ant-${ant_version}-bin.tar.bz2"
ivy_file="apache-ivy-${ivy_version}-bin.tar.gz"
ant_url="https://downloads.apache.org/ant/binaries/${ant_file}"
ivy_url="https://downloads.apache.org/ant/ivy/${ivy_version}/${ivy_file}"
mkdir -p "$HOME/.ant/"{home,lib,bootstrap}
[[ ! -r "$bs_home/$ant_file" ]] && { echo -n 'downloading and installing ant...' && curl -so "$bs_home/$ant_file" "$ant_url" && tar -C $bs_home -jxf "$bs_home/$ant_file" && echo ' done.' || { echo "ERROR (ant)"; exit 1; } }
[[ ! -r "$bs_home/$ivy_file" ]] && { echo -n 'downloading and installing ivy...' && curl -so "$bs_home/$ivy_file" "$ivy_url" && tar -C $bs_home -xxf "$bs_home/$ivy_file" && echo ' done.' || { echo "ERROR (ivy)"; exit 1; } }
ln -sf "$bs_home/apache-ant-${ant_version}"/{lib,bin} "$HOME/.ant/home"
ln -sf "$bs_home/apache-ivy-${ivy_version}/ivy-${ivy_version}.jar" "$HOME/.ant/lib"
ln -sf "$bs_home/apache-ivy-${ivy_version}/ivy-${ivy_version}.jar" "$HOME/.ant/home/lib"
cat > "$HOME/.ant/ivysettings.xml" <<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<ivysettings>
<include url="\${ivy.default.settings.dir}/ivysettings.xml"/>
<credentials host="jars.law.di.unimi.it" realm="Sonatype Nexus Repository Manager" username="lawdevel" passwd="l4w"/>
<resolvers>
<ibiblio name="sonatype" m2compatible="true" root="https://oss.sonatype.org/content/repositories/public/"/>
<ibiblio name="law-snapshots" m2compatible="true" root="http://jars.law.di.unimi.it/content/repositories/snapshots" checkmodified="true" changingPattern=".*-SNAPSHOT"/>
<ibiblio name="law-public" m2compatible="true" root="http://jars.law.di.unimi.it/content/repositories/public/"/>
<chain name="default" returnFirst="true">
<resolver ref="local"/>
<resolver ref="law-snapshots"/>
<resolver ref="law-public"/>
<resolver ref="sonatype"/>
<resolver ref="main"/>
</chain>
</resolvers>
<caches defaultCacheDir="\${user.home}/.ivy/cache" />
</ivysettings>
EOF
cat <<EOF
Please add
export ANT_HOME="$HOME/.ant/home"
export PATH="\$ANT_HOME/bin:\$PATH"
export LOCAL_IVY_SETTINGS="$HOME/.ant/ivysettings.xml"
to your .bash_profile and remember to point your Eclipse IvyIDE plugin to the settings in
$HOME/.ant/ivysettings.xml
containing the configuration (and password) to use jars.law.di.unimi.it as a primary jar repo.
EOF