How can you create an executable jar with dependencies using maven?
Answer Posted / Shakti Singh
To create an executable JAR with dependencies using Maven, add the following plugins to your pom.xml:
```xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
```
Then run the `assembly:assembly` goal.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers