mvn Verified current stable Not installed? Build Tools

Mvn / Package Project Update Dependencies Common

Package Project Update Dependencies Common

Use 'mvn package' to compile and package your project while updating snapshot dependencies if needed.

$
Terminal
mvn package -U

When To Use

Use this command to build your project and ensure dependencies are up to date.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
mvn package -U

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ my-project ---
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ my-project ---
[INFO] Building jar: /path/to/my-project/target/my-project-1.0-SNAPSHOT.jar
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ my-project ---
[INFO] Installing /path/to/my-project/target/my-project-1.0-SNAPSHOT.jar to /path/to/.m2/repository/com/example/my-project/1.0-SNAPSHOT/my-project-1.0-SNAPSHOT.jar

Command Breakdown

What each part is doing

mvn
Base Command
The executable that performs this operation. Here it runs Mvn before the shell applies any redirect operators.
-U
U| update snapshots
The value supplied for U| update snapshots.
-U
Command Option
Tool-specific option used by this command invocation.

How To Run

Execution path

  1. Step 1

    Open your terminal and navigate to the project directory.

  2. Step 2

    Run the command: mvn package -U to package the project and update snapshots.

  3. Step 3

    Check the target directory for the generated package.

Alternative Approaches

Comparable commands in other tools

Alternative build tools tools for the same job.