Forrest logo
back to the mvn tool

mvn:tldr:ea9d9

mvn: Do a clean and then invoke the package phase.
$ mvn clean package
try on your machine

The command "mvn clean package" is used in Maven (a build automation tool) to clean and package a project. Let's break it down:

  • "mvn" stands for Maven, which is the command to invoke Maven.
  • "clean" is a life cycle phase in Maven. This phase removes any existing build artifacts and temporary files, such as compiled classes and build outputs.
  • "package" is also a life cycle phase, which is responsible for packaging the project into a distributable format like JAR or WAR. It includes compiling the source code, running unit tests, and creating the artifact.

So, when you run "mvn clean package" command, Maven will clean the project (removing any existing build files) and then package it into an output format specified by the project configuration (usually JAR or WAR).

This command is commonly used during the software development process to ensure a clean and latest version of the project is built for distribution or deployment.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the mvn tool