--Install Java and maven (https://qiita.com/amemolee/items/6f33b8e321cc9395b0cf) -Tomcat for Java Install the plugin in VScode --DL Tomcat (http://tomcat.apache.org/) * Please select the version of Tomcat depending on your environment.
After DLing Tomcat, unzip it and place it in any directory. If it is macOS, it seems better to place it under Applications.
After installing the Tomcat for Java plugin
Press Command + P, type > Add Tomcat Server
, and press Enter.
Select the directory where Tomcat is located.
Make sure pom.xml
is generated in the project root and do the following in the project root
mvn install
mvn compile
mvn package
Confirm that the .war file has been generated.
On VSCode, press Command + P, type > Tomcat: Runon Tomcat Server
, and press Enter.
Select a war file.
Refer to the war file and start Tomcat.
With the default settings, it will start at localhost: 8080.
http://localhost:8080 You can check the following screen by accessing.
FAQ
--Check the path
--If you have done mvn install once, run mvn clean
and run mvn install
again.
--It seems that when you do mvn install, it caches the contents executed in pom.xml.
TODO I will write about how to create mvn and JSP / Servlet projects from 0 base later!
Recommended Posts