-
Notifications
You must be signed in to change notification settings - Fork 1
/
wercker-box.yml
39 lines (30 loc) · 1.35 KB
/
wercker-box.yml
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
name: java
version: 0.1.3
inherits: wercker/[email protected]
type: main
platform: [email protected]
description: Wercker box for Java development
packages:
- oracle-java7
script: |-
# Remove java from base box
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
# Assert that java is not available anymore
! type java || { echo "I expected java to be not available. Java version is: $(java -version). Aborting."; exit 1; }
# Add webupd8 team repository that contains the 3 major oracle-java versions
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
# Accept the oracle license
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
# Install oracle-java7
sudo apt-get install oracle-java7-installer -y -qq
# We should have java again
type java || { echo "I expected java to be available after oracle-java7-installer installation. Aborting."; exit 1; }
# Install ant
sudo apt-get install ant ant-contrib ivy ivy-doc -y -qq
# We should have ant and ivy available
type ant || { echo "I expected ant to be available. Aborting."; exit 1; }
# Install maven
sudo apt-get install maven -y -qq
type mvn || { echo "I expected maven to be available. Aborting."; exit 1; }