Running with Maven
The simplest way to run the application is using Maven Wrapper:http://localhost:8080
The first run may take longer as Maven downloads dependencies.
With Specific Profile
Run with a specific Spring profile:With Environment Variables
Pass environment variables at runtime:Running from IDE
IntelliJ IDEA
1
Import the project
- Open IntelliJ IDEA
- Select File → Open
- Navigate to the project directory and select
pom.xml - Choose Open as Project
2
Wait for Maven import
IntelliJ will automatically import Maven dependencies. Wait for the process to complete.
3
Run the application
- Navigate to
src/main/java/com/tecmilenio/edutec/EdutecApplication.java - Right-click on the file or the
mainmethod - Select Run ‘EdutecApplication’
4
Configure run settings (optional)
- Click Run → Edit Configurations
- Set environment variables, VM options, or active profiles
- Example: Add
SPRING_PROFILES_ACTIVE=devto environment variables
Eclipse
1
Import Maven project
- File → Import → Maven → Existing Maven Projects
- Browse to the project directory
- Click Finish
2
Run as Spring Boot App
- Right-click on the project
- Select Run As → Spring Boot App
Visual Studio Code
1
Open the project folder
- File → Open Folder
- Select the project directory
2
Install recommended extensions
VS Code will prompt to install Java and Spring extensions. Accept the recommendations.
3
Run the application
- Open
EdutecApplication.java - Click Run or Debug above the
mainmethod - Or press
F5to start debugging
Building the JAR
Create an executable JAR file for deployment:target/com.escolar-0.0.1-SNAPSHOT.jar
Running the JAR
Once built, run the JAR directly:Accessing the Application
Once the application starts, you’ll see:- Base URL:
http://localhost:8080 - H2 Console (if enabled):
http://localhost:8080/h2-console - Swagger UI (if configured):
http://localhost:8080/swagger-ui.html
Testing Endpoints
Using cURL
Test the authentication endpoint:Using Postman
1
Create a new request
- Method: POST
- URL:
http://localhost:8080/auth/login
2
Set headers
Add header:
3
Set request body
Select Body → raw → JSON and enter:
4
Send the request
Click Send and view the JWT token in the response.
Using HTTPie
A more user-friendly alternative to cURL:Hot Reload with DevTools
The project includes Spring Boot DevTools for automatic application restart during development.How It Works
- Automatic Restart: When you modify and save Java files, the application automatically restarts
- LiveReload: Browser auto-refresh when static resources change (requires browser extension)
- Property Defaults: Optimized default properties for development
Triggering a Restart
1
Make code changes
Modify any Java file in your IDE
2
Save the file
The application will detect changes and restart automatically
3
Wait for restart
Watch the console for:
Changes to
pom.xml or configuration files require a full manual restart.Troubleshooting Common Issues
Port Already in Use
Error:Web server failed to start. Port 8080 was already in use.
Solution 1: Kill the process using port 8080
application.properties
Database Connection Failed
Error:Cannot create PoolableConnectionFactory
Solutions:
- Verify MySQL is running:
systemctl status mysql(Linux) or check Services (Windows) - Check database credentials in
application.properties - Ensure database exists:
CREATE DATABASE edutec; - Switch to H2 for development (see Configuration)
JDBC Driver Not Found
Error:No suitable driver found for jdbc:mysql://...
Solution: Ensure MySQL connector dependency is in pom.xml and rebuild:
Java Version Mismatch
Error:Unsupported class file major version
Solution: Verify Java 8 is being used:
JAVA_HOME if needed:
Maven Build Failed
Error: Various build errors Solutions:Application Starts but Endpoints Return 404
Possible Causes:- Controller not scanned by Spring Boot
- Incorrect request mapping
- Context path configured
- Check application logs for registered mappings:
-
Verify controller package is under
com.tecmilenio.edutec -
Check if context path is set in
application.properties
H2 Console Not Accessible
Solution: Enable H2 console inapplication.properties:
Performance Tips
Useful Development Commands
Next Steps
Authentication API
Test the login endpoint
User Model
Explore the User entity
Configuration
Application configuration guide
Architecture
Understand the system architecture