Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How can you create an executable jar with dependencies using maven?



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

Post New Answer

More Apache Maven Interview Questions

What is maven selenium?

1 Answers  


How to force the intellij idea to reread/update all dependencies specified in the pom file?

1 Answers  


Explain what is maven repository? What are their types?

1 Answers  


What is a system dependency?

1 Answers  


How do I determine which pom contains missing transitive dependency?

1 Answers  


How can you create an executable jar with dependencies using maven?

1 Answers  


What does it mean when you say maven uses convention over configuration?

1 Answers  


Mention the difference between Apache Ant and Maven?

1 Answers  


List the differences between ant and maven.

1 Answers  


Explain how to run test classes in Maven?

1 Answers  


Explain the difference between dependency and plugin in maven?

1 Answers  


What are the types of maven plugins?

1 Answers  


Categories