Skip to content

Latest commit

 

History

History
61 lines (51 loc) · 1.15 KB

CMD.md

File metadata and controls

61 lines (51 loc) · 1.15 KB

Basic Maven Commands for Spring Boot

Clean the project:

Removes the target directory where compiled files are stored.

mvn clean

Compile the project:

Compiles the source code of the project.

mvn compile

Run tests:

Executes all unit tests.

mvn test

Package the project:

Packages the compiled code into a .jar or .war file inside the target folder.

mvn package

Run the Spring Boot Application:

Starts the Spring Boot application directly from the command line.

mvn spring-boot:run

Install the package locally:

Compiles, tests, and installs the package into your local Maven repository (~/.m2/repository).

mvn install

Skip tests during build:

Speeds up the build process by skipping tests.

mvn clean install -DskipTests

Run a specific test class:

Runs a specific test class.

mvn -Dtest=ClassNameTest test

Generate project documentation (site):

Builds a documentation site for the project.

mvn site

Update project dependencies:

Forces Maven to update all dependencies from remote repositories.

mvn clean install -U