Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CommandDescriptionNotes
mvn cleanremoves all the files created by the previous buildUsually means it deletes the contents of the modules */target/ directory.
mvn validatevalidates that the maven poms are all correct and that no config is missingUsefull to run when making build modifications to ensure consistency.
mvn compilecompiles the source code of the projectThis will verify that project dependencies are correct.
mvn testexecutes the unit testsShould not rely on code being packaged or deployed, only unit tests.

mvn package

packages the code into the its distributable formats (jar, war, zip etc)Each pom specifies what the distribution format is, default is POM.
mvn verifyverifies that the packaged code is validThis will run the integration and system tests.
mvn installinstalls the package into the local maven repositoryThis will result in the module being available, locally, as a depedency
mvn deploycopies the final artifacts to the remote maven repository for sharingThis would happen only when modules ready to be shared with other developers or projects
mvn site:stagecreates a staged version of the maven site with all the reports

Staging output defaults to the */target/staging/ directory

mvn jacoco:reportgenerates the code coverage report for the tests that have been executedTest output appears in the */target/site/jacoco/ directory

...