I have a Maven project which I need to run from VSCode. Right now the way I do it is:
- Open the project folder in VSCode. Edit the java, js, html files etc.
- Start my tomcat by running
bin/startup.sh; tail -f logs/* ;
in the apache tomcat's directory. Open terminal in the project directory and run
mvn clean install -DskipTests
.Then run
cp /Users/path-to-my-project/target/myWebApp.war ~/apache-tomcat-8.5.23/webapps/
to copy the war file into the tomcat's webapp directory.
After which I can access my web application at localhost:8080/myWebApp.
Is it possible to do all of this in one click (or command) in VSCode. I know it can be done in Eclipse or IntelliJ but I want to work with VSCode.
I have installed the Spring Boot Extension Pack and Java Extension Pack in VSCode. I am just confused on how to setup the path to my tomcat, build the project and then copy the war file to the tomcat webapps folder.