Setting | Value |
---|---|
Purpose | Debug a Java web app using Tomcat and VS Code |
Server | Apache Tomcat |
Server Language | Java |
Architecture | Maven |
IDE | Visual Studio Code |
License | GPL v3 |
Tutorial | [Youtube Tutorial](https://www.youtube.com/watch?v=R9mugpHWr14 |
This project uses Java, Tomcat and Maven. Install the Java Extension pack to get the Java features needed. And Install the Tomcat for Java extension too.
- Install Java Extension Pack
- Install Tomcat for Java
Download the Apache Tomcat binaries and save them into a memorable directory.
- Dial up Apache Tomcat latest Downloads. Select the latest version to download.
- Find and download the latest Core Zip.
- Unzip the server into your memorable directory. I put it in ~/servers/tomcat/apache-tomcat-x.x.xx.
- In VS Code, file explorer, at the bottom under Tomcat Servers, add the server by and point to the ~/servers/tomcat/apache-tomcat-x.x.xx directory.
I created a Maven architecture web app project. It's much easier to manage the dependencies and build instructions for the IDE and CI systems with something like Maven.
- Run this to generate a maven web app project.
mvn org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate -DarchetypeArtifactId="maven-archetype-webapp" -DarchetypeGroupId="org.apache.maven.archetypes" -DarchetypeVersion="1.4"
- Add the default Java source directory ./src/main/java
- Add the initial package directory. For example com.brandondonnelson would become ./src/main/java/com/brandondonnelson