How I deployed my Java Springboot App with MYSQL in AWS for free
5. Deploy the spring application in cloud EC2

Clone the branch in git and switch to right branch.

now at root directory where pom.xml exits run

mvn package

It should be success.

So, .war file has been created. you can check it in target folder. Now run (replace with your own generated .war file)

java -jar target/ecommerce-backend-0.0.1-SNAPSHOT.war

Go to the public dns name of the EC2 and run your application with correct port and part.

Next step

Great your app is running in aws. But there is one problem, what happens when you want to change your code and redeploy ? Well this tutorial is not for production codebase, which you can learn here

but I will give you my script to make it easy redeploying. Run

sh run.sh

With one command, you can redeploy your application again and your new code is live again. Works perfectly when you want to try out AWS, without going through the complexity of buildspec.yaml files. Also you can deploy multiple applications in same ec2 instance in different ports !

Resources

https://bitbucket.org/ecommerce-webtutsplus/ecommerce/src
['Nil Madhab']
['Deployment', 'DevOps', 'Ec2', 'AWS', 'Technology']