mvn Verified current stable Not installed? Build Tools

Mvn / Package Project Skip Tests Common

Package Project Skip Tests Common

Use 'mvn package -DskipTests' to build your Maven project without running tests, speeding up the process.

$
Terminal
mvn package -D skipTests

When To Use

Use this command to package a Maven project without executing tests.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
mvn package -D skipTests

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ my-project ---
[INFO] Compiling 1 source file to /path/to/my-project/target/classes
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ my-project ---
[INFO] Copying 1 resource to /path/to/my-project/target/classes
[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

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.
-D
D| define
The value supplied for D| define.
-D
Command Option
Tool-specific option used by this command invocation.

How To Run

Execution path

  1. Step 1

    Open your terminal.

  2. Step 2

    Run the command: mvn package -DskipTests.

  3. Step 3

    Check the target directory for the packaged artifact.

Alternative Approaches

Comparable commands in other tools

Alternative build tools tools for the same job.