- Go to Edit Configurations in the dropdown next to the run button
- In the Run/Debug Configurations window, click the + icon in the top left and select Maven from the list.
- Ensure working directory points to project root
- Under Command Line, enter
spring-boot:run
- Next to Java options, click the gear icon and ensure Environment Variables is selected
- Under Java Options, in the Environment Variables field, enter
DB_USERNAME=<YOUR POSTGRES USERNAME>, DB_PASSWORD=<YOUR POSTGRES PASSWORD>
, making sure to enter your postgres username and password for theTutorBridge
database - You can now run the server by clicking the run icon from any file
-
Make sure Java Extension Pack and Spring Boot Extension Pack are installed
-
Go to the Run and Debug tab on the sidebar
-
Click Create a launch.json file, and then select java (what you select here doesn't really matter, because the next step contains the full launch.json file. So, optionally, you can directly create the launch.json file in the path
.vscode/launch.json
) -
Delete any code in this file and paste the following
{ "version": "0.2.0", "configurations": [ { "type": "java", "request": "launch", "name": "Run Spring Boot with Maven", "runtimeExecutable": "mvn", "args": [ "spring-boot:run" ], "env": { "DB_USERNAME": "<YOUR POSTGRES USERNAME>", "DB_PASSWORD": "<YOUR POSTGRES PASSWORD>" }, "console": "integratedTerminal", "cwd": "${workspaceFolder}" } ] }
-
Make sure to save
-
You can now run the server by clicking
Run Spring Boot with Maven
in the Run and Debug tab in the sidebar
- Ensure postgres and PGAdmin is installed, if not you can download from https://www.postgresql.org/download/
- If you're going to use the default user
postgres
, set a password for it, and add it as an environment variable according to instructions above - Create DB
TutorBridge
, and set a user that can be anything, but by default you can usepostgres