Monday, 5th August 2024
APPLICATION SOFTWARE BUILD
APACHE MAVEN-JAVA BUILD TECHNOLOGY
1. What is maven/maven presentations
2. Create an ec2 instance
a. First we create a key pair . key pairs allow us to
ssh/login into the instance.
b. The keypair is then download to your download
folder on your computer
c. Creating the ec2 instance
3. Connect to the instance and install apache maven
To connect your aws ec2 instances , you need the
following parameters.
a. The keypair . my keypair is prof.pem
b. The server: ubuntu
c. Ip or dns of the server:
d. Open an ssh client - most preferably - git bash
Server url: ssh -i "prof.pem"-central1.compute.amazonaws.com
How to connect to the instance
1. Open git bash
2. Change directory to Downloads
# cd downloads
3. Copy and paste the example link from aws cloud #
ssh -i "prof.pem"
4. Install apache maven
HOW TO INSTALL MAVEN ON UBUNTU - AMAZON
EC2 INSTANCE
a. Update the system
# sudo apt update
b. Install Java
# sudo apt install openjdk-11-jdk
c. Verify Java Installation
# java --version
d. Change directory to the opt directory
# cd /opt
e. Download maven 3.6.3 from the apache maven
website
# sudo wget
https://archive.apache.org/dist/maven/maven3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
f. Extract the maven package
# sudo tar xf apache-maven-*.tar.gz
g. Rename and create a Softlink
# sudo ln -s /opt/apache-maven-3.6.3 /opt/maven
Remove the apache-maven tar file
# sudo rm -rf apache-maven-3.6.3-bin.tar.gz
h. Perform maven configuration
# sudo vi /etc/profile.d/maven.sh
i. paste the following
# export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
# export M2_HOME=/opt/maven
# export MAVEN_HOME=/opt/maven
# export PATH=${M2_HOME}/bin:${PATH}
j. Make the script executable
# sudo chmod +x /etc/profile.d/
# source /etc/profile.d/maven.sh
k. Verify Maven installation
# mvn --version