A company uses CI/CD to build and package a Java 17 application. They want to produce a single executable JAR that includes all dependencies. Which tool should be used to achieve this?
Trap 1: Maven JAR Plugin
Maven JAR Plugin creates a standard JAR without dependencies.
Trap 2: Java jar command
The jar command packages files but does not resolve dependencies.
Trap 3: jlink tool
jlink creates a custom runtime image, not an executable JAR.
- A
Maven JAR Plugin
Why wrong: Maven JAR Plugin creates a standard JAR without dependencies.
- B
Maven Shade Plugin
Maven Shade Plugin creates an uber-JAR with all dependencies.
- C
Java jar command
Why wrong: The jar command packages files but does not resolve dependencies.
- D
jlink tool
Why wrong: jlink creates a custom runtime image, not an executable JAR.