How can you create an executable jar with dependencies using maven?
Answer / 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 |
What is maven selenium?
How to force the intellij idea to reread/update all dependencies specified in the pom file?
Explain what is maven repository? What are their types?
What is a system dependency?
How do I determine which pom contains missing transitive dependency?
How can you create an executable jar with dependencies using maven?
What does it mean when you say maven uses convention over configuration?
Mention the difference between Apache Ant and Maven?
List the differences between ant and maven.
Explain how to run test classes in Maven?
Explain the difference between dependency and plugin in maven?
What are the types of maven plugins?