Build war with maven and sparkjava framework
Exercise:
- Create an instance
- Login into the console
- Clone the https://github.com/DanielaZacarias/sparkjava-war-example.git
- Install tomcat, java, maven
- Compile the code
- Upload the artifact to tomcat
Steps:
- Download a fresh Tomcat 8 distribution
- Clone this repository to your local machine
- Run mvn package
- Copy the generated
sparkjava-hello-world-1.0.warto the Tomcatwebappsfolder (EC2 PATH: /usr/share/tomcat/webapps) - Start Tomcat by running
sudo systemctl start tomcatfor EC2) - Tomcat will automatically deploy the war
- Open [https://(IP public EC2)/sparkjava-hello-world-1.0/hello] in your browser