Perform the below step only when you launch a new ec2 instance. This command updates all the packages with latest version.
sudo yum update -y
sudo yum install git -y
Download the spring-boot application from repository at any specific location
sudo git clone https://github.com/TheCloudWorld/spring-boot-demo-app.git
Perform the below steps to install all the dependent packages
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
sudo yum install java-1.8.0-openjdk-devel.x86_64 -y
Build the Artifact
mvn clean install
You will get your ".jar" file in the target folder. Move the .Jar file to any specific application location, from where you want to run the application. Then perform the below step to run the application.
java -jar JAR_FILE_NAME.jar
"OR"
nohup java -jar JAR_FILE_NAME.jar > /dev/null 2>&1 &