How can I create an executable JAR with dependencies using Maven

0 votes

How can I make Maven package all dependency JARs into my JAR?

Apr 26, 2018 in Java by Akrati
• 3,190 points
996 views

1 answer to this question.

0 votes
<build>
  <plugins>
    <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <configuration>
        <archive>
          <manifest>
            <mainClass>fully.qualified.MainClass</mainClass>
          </manifest>
        </archive>
        <descriptorRefs>
          <descriptorRef>jar-with-dependencies</descriptorRef>
        </descriptorRefs>
      </configuration>
    </plugin>
  </plugins>
</build>

answered Apr 26, 2018 by sophia
• 1,400 points

Related Questions In Java

0 votes
1 answer

How can I create an executable JAR with dependencies using Maven?

Hello @kartik, You can use the dependency-plugin to ...READ MORE

answered May 28, 2020 in Java by Niroj
• 82,880 points
5,643 views
0 votes
2 answers

How can I create File and write data in it using Java?

import java.io.BufferedWriter; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; public class WriteFiles{ ...READ MORE

answered Jul 26, 2018 in Java by samarth295
• 2,220 points
2,576 views
0 votes
3 answers

How can I add new elements to an Array in Java

String[] source = new String[] { "a", ...READ MORE

answered Sep 19, 2018 in Java by Sushmita
• 6,910 points
11,640 views
0 votes
2 answers
0 votes
2 answers

How can we add the local JAR files to the Maven Project in Java?

Firstly I would like to give credit ...READ MORE

answered Nov 5, 2018 in Java by Sushmita
• 6,910 points
10,396 views
+1 vote
1 answer

How to tell the Maven to use the latest version of dependency in Java?

If you always want to use the ...READ MORE

answered Jun 26, 2018 in Java by Sushmita
• 6,910 points
14,747 views
0 votes
1 answer

Including dependencies in a jar with Maven

You can do this using the maven-assembly-plugin ...READ MORE

answered Jul 21, 2018 in Java by samarth295
• 2,220 points
14,896 views
0 votes
1 answer

Add jars to maven 2 build class path without installing them?

wn voteA quick&dirty batch solution (based on Alex's answer): libs.bat @ECHO ...READ MORE

answered Aug 30, 2018 in Java by samarth295
• 2,220 points
949 views
0 votes
2 answers

How an object array can be converted to string array in java?

System.arraycopy is the most efficient way, but ...READ MORE

answered Aug 8, 2018 in Java by Sushmita
• 6,910 points
4,797 views
0 votes
1 answer

How can a war file be deployed in Tomcat 7?

You can access your application from: http://localhost:8080/sample Deploying ...READ MORE

answered Apr 20, 2018 in Java by sophia
• 1,400 points
1,922 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP