Maven
Install¶
Install Maven using SDKMAN with the following command:
Wrapper¶
The Maven Wrapper is an excellent tool to ensure that all developers use the same version of Maven. It is a set of files that you can commit to your project, and it will download the correct version of Maven when you run it.
To create the Maven Wrapper, run the following command:
We can also specify the version of Maven to use:
Note: The option
-N
means non-recursive, and it tells Maven to execute the command only in the current project and not in the modules.
Usage¶
Build¶
To build a project, run the following command:
To skip the tests, run the following command:
Test¶
To run test in a project, run the following command:
Debug¶
To debug a Maven build, run the following command:
Verify¶
To verify mvn package is valid and meets quality criteria of a project, run the following command:
Package¶
To package a project, run the following command:
Deploy¶
To deploy a project, run the following command:
Release¶
To release a project, run the following command:
Upgrade wrapper¶
To upgrade the Maven Wrapper, run the following command:
Update dependencies¶
To display the new versions of the dependencies in a project, run the following command:
To update the dependencies in a project, run the following command:
To display the new versions of the plugins in a project, run the following command: