In the project directory
mvn spring-boot:run
Install the dependencies listed in pom.xml
and starts the app in the development mode.
Open http://localhost:8080 to view it in the browser.
mvn test
Run all the Unit Tests.
mvn test jacoco:report
Run the Unit Tests and generates test coverage report target\site\jacoco\index.html
mvn clean package
Create a new .jar file under target
folder
java -jar target/datemath-api-1.0.0.jar --trace
Run the .jar file. You can access Swagger Documents here.
Click here to test API endpoint after the application is running
ssh -i "<path to local .pem file>" [email protected]
SSH into the AWS EC2 server.
yum search java | grep -i --color JDK
Search for available JDK packages in Yum
Download and Install JDK 15
curl -0 https://download.java.net/openjdk/jdk15/ri/openjdk-15+36_linux-x64_bin.tar.gz --output openjdk-15+36_linux-x64_bin.tar.gz
\tar zxvf openjdk-15+36_linux-x64_bin.tar.gz
\sudo mv jdk-15/ /usr/local/
Setup the JDK Path
sudo vi /etc/profile.d/jdk15.sh
export JAVA_HOME=/usr/local/jdk-15
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile.d/jdk15.sh
java -version
ssh -i "<path to local .pem file>" [email protected]
SSH into the AWS EC2 server.
kill -9 $(lsof -t -i:8080)
Stop running the existing .jar file and back it up
scp -i "<path to local .pem file>" target/<jar file name> [email protected]:/home/ec2-user
Copy the .jar file from project folder to AWS EC2 server
nohup java -jar datemath-api-1.0.0.jar > output.log 2>&1 &
Run the .jar file in background