Maven build not exporting dependent library's for packaging type jar












2














I need to create a runnable jar file that will be operated in Batch mode.
During development I need to use following api/frameworks apache-poi,hibernate,Spring etc.



So,I prefer to go with maven:



Please find below my maven file:



<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mypackage</groupId>
<artifactId>myartifact</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.17.Final</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>5.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>5.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>fully.qualified.classpath.Main</mainClass>
</manifest>
<manifestEntries>
<Class-Path>.</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>


I am running the maven build from eclipse as clean package.
Build completes successfully.But in the generated jar all the dependent jar
is not present [spring/hibernate/poi] etc.



We need to run this jar as java -jar jarname from command prompt/console.










share|improve this question



























    2














    I need to create a runnable jar file that will be operated in Batch mode.
    During development I need to use following api/frameworks apache-poi,hibernate,Spring etc.



    So,I prefer to go with maven:



    Please find below my maven file:



    <project xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
    http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>mypackage</groupId>
    <artifactId>myartifact</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>
    <properties>
    <java.version>1.8</java.version>
    </properties>
    <dependencies>
    <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>5.2.17.Final</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>5.0.6.RELEASE</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
    <version>5.0.6.RELEASE</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jms</artifactId>
    <version>5.0.6.RELEASE</version>
    </dependency>
    <dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.17</version>
    </dependency>
    <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>3.8.1</version>
    </dependency>
    </dependencies>
    <build>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
    <archive>
    <manifest>
    <addClasspath>true</addClasspath>
    <mainClass>fully.qualified.classpath.Main</mainClass>
    </manifest>
    <manifestEntries>
    <Class-Path>.</Class-Path>
    </manifestEntries>
    </archive>
    </configuration>
    </plugin>
    </plugins>
    </build>
    </project>


    I am running the maven build from eclipse as clean package.
    Build completes successfully.But in the generated jar all the dependent jar
    is not present [spring/hibernate/poi] etc.



    We need to run this jar as java -jar jarname from command prompt/console.










    share|improve this question

























      2












      2








      2







      I need to create a runnable jar file that will be operated in Batch mode.
      During development I need to use following api/frameworks apache-poi,hibernate,Spring etc.



      So,I prefer to go with maven:



      Please find below my maven file:



      <project xmlns="http://maven.apache.org/POM/4.0.0" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
      http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>mypackage</groupId>
      <artifactId>myartifact</artifactId>
      <version>1.0</version>
      <packaging>jar</packaging>
      <properties>
      <java.version>1.8</java.version>
      </properties>
      <dependencies>
      <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <version>5.2.17.Final</version>
      </dependency>
      <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>5.0.6.RELEASE</version>
      </dependency>
      <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-orm</artifactId>
      <version>5.0.6.RELEASE</version>
      </dependency>
      <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jms</artifactId>
      <version>5.0.6.RELEASE</version>
      </dependency>
      <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi</artifactId>
      <version>3.17</version>
      </dependency>
      <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.8.1</version>
      </dependency>
      </dependencies>
      <build>
      <plugins>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <configuration>
      <archive>
      <manifest>
      <addClasspath>true</addClasspath>
      <mainClass>fully.qualified.classpath.Main</mainClass>
      </manifest>
      <manifestEntries>
      <Class-Path>.</Class-Path>
      </manifestEntries>
      </archive>
      </configuration>
      </plugin>
      </plugins>
      </build>
      </project>


      I am running the maven build from eclipse as clean package.
      Build completes successfully.But in the generated jar all the dependent jar
      is not present [spring/hibernate/poi] etc.



      We need to run this jar as java -jar jarname from command prompt/console.










      share|improve this question













      I need to create a runnable jar file that will be operated in Batch mode.
      During development I need to use following api/frameworks apache-poi,hibernate,Spring etc.



      So,I prefer to go with maven:



      Please find below my maven file:



      <project xmlns="http://maven.apache.org/POM/4.0.0" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
      http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>mypackage</groupId>
      <artifactId>myartifact</artifactId>
      <version>1.0</version>
      <packaging>jar</packaging>
      <properties>
      <java.version>1.8</java.version>
      </properties>
      <dependencies>
      <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <version>5.2.17.Final</version>
      </dependency>
      <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>5.0.6.RELEASE</version>
      </dependency>
      <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-orm</artifactId>
      <version>5.0.6.RELEASE</version>
      </dependency>
      <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jms</artifactId>
      <version>5.0.6.RELEASE</version>
      </dependency>
      <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi</artifactId>
      <version>3.17</version>
      </dependency>
      <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.8.1</version>
      </dependency>
      </dependencies>
      <build>
      <plugins>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <configuration>
      <archive>
      <manifest>
      <addClasspath>true</addClasspath>
      <mainClass>fully.qualified.classpath.Main</mainClass>
      </manifest>
      <manifestEntries>
      <Class-Path>.</Class-Path>
      </manifestEntries>
      </archive>
      </configuration>
      </plugin>
      </plugins>
      </build>
      </project>


      I am running the maven build from eclipse as clean package.
      Build completes successfully.But in the generated jar all the dependent jar
      is not present [spring/hibernate/poi] etc.



      We need to run this jar as java -jar jarname from command prompt/console.







      java maven






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 '18 at 8:14









      Sumit GhoshSumit Ghosh

      140314




      140314
























          3 Answers
          3






          active

          oldest

          votes


















          2














          Consider using Maven Shade Plugin.




          This plugin provides the capability to package the artifact in an uber-jar, including its dependencies




          Spring framework can do similar thing for you. Generate sample project and check its pom file.






          share|improve this answer























          • I cannot go with spring boot since my application is kind of a cron job application.It will be triggered by a third party app just like a batch job
            – Sumit Ghosh
            Nov 21 '18 at 9:00










          • Have you seen scheduling feature?
            – matejko219
            Nov 21 '18 at 9:18










          • I know that.but it is not based on time exactly.it will be triggred based on some third party event
            – Sumit Ghosh
            Nov 21 '18 at 9:25



















          0














          maven-jar-plugin provides the capability to build jars without dependencies.
          To create jar with all it's dependencies you can use maven-assembly-plugin or maven-shade-plugin. Below is maven-assembly-plugin configuration in pom.xml:



          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <executions>
          <execution>
          <phase>package</phase>
          <goals>
          <goal>single</goal>
          </goals>
          <configuration>
          <archive>
          <manifest>
          <mainClass>
          fully.qualified.classpath.Main
          </mainClass>
          </manifest>
          </archive>
          <descriptorRefs>
          <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          </configuration>
          </execution>
          </executions>
          </plugin>


          More information: executable-jar-with-maven






          share|improve this answer





















          • maven-shade-plugin solve the issue.but while running using java -jar option it gives a separate exception as follows:: Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 651; cvc-elt.1: Cannot find the declaration of element 'beans'.
            – Sumit Ghosh
            Nov 21 '18 at 8:45





















          0














          Try this out inside your pom.xml file:



          <build>
          <plugins>
          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.8</version>
          <executions>
          <execution>
          <id>copy-dependencies</id>
          <phase>prepare-package</phase>
          <goals>
          <goal>copy-dependencies</goal>
          </goals>
          <configuration>
          <outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
          <includeScope>runtime</includeScope>
          </configuration>
          </execution>
          </executions>
          </plugin>
          </plugins>







          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407728%2fmaven-build-not-exporting-dependent-librarys-for-packaging-type-jar%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            Consider using Maven Shade Plugin.




            This plugin provides the capability to package the artifact in an uber-jar, including its dependencies




            Spring framework can do similar thing for you. Generate sample project and check its pom file.






            share|improve this answer























            • I cannot go with spring boot since my application is kind of a cron job application.It will be triggered by a third party app just like a batch job
              – Sumit Ghosh
              Nov 21 '18 at 9:00










            • Have you seen scheduling feature?
              – matejko219
              Nov 21 '18 at 9:18










            • I know that.but it is not based on time exactly.it will be triggred based on some third party event
              – Sumit Ghosh
              Nov 21 '18 at 9:25
















            2














            Consider using Maven Shade Plugin.




            This plugin provides the capability to package the artifact in an uber-jar, including its dependencies




            Spring framework can do similar thing for you. Generate sample project and check its pom file.






            share|improve this answer























            • I cannot go with spring boot since my application is kind of a cron job application.It will be triggered by a third party app just like a batch job
              – Sumit Ghosh
              Nov 21 '18 at 9:00










            • Have you seen scheduling feature?
              – matejko219
              Nov 21 '18 at 9:18










            • I know that.but it is not based on time exactly.it will be triggred based on some third party event
              – Sumit Ghosh
              Nov 21 '18 at 9:25














            2












            2








            2






            Consider using Maven Shade Plugin.




            This plugin provides the capability to package the artifact in an uber-jar, including its dependencies




            Spring framework can do similar thing for you. Generate sample project and check its pom file.






            share|improve this answer














            Consider using Maven Shade Plugin.




            This plugin provides the capability to package the artifact in an uber-jar, including its dependencies




            Spring framework can do similar thing for you. Generate sample project and check its pom file.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 21 '18 at 8:25

























            answered Nov 21 '18 at 8:19









            matejko219matejko219

            60339




            60339












            • I cannot go with spring boot since my application is kind of a cron job application.It will be triggered by a third party app just like a batch job
              – Sumit Ghosh
              Nov 21 '18 at 9:00










            • Have you seen scheduling feature?
              – matejko219
              Nov 21 '18 at 9:18










            • I know that.but it is not based on time exactly.it will be triggred based on some third party event
              – Sumit Ghosh
              Nov 21 '18 at 9:25


















            • I cannot go with spring boot since my application is kind of a cron job application.It will be triggered by a third party app just like a batch job
              – Sumit Ghosh
              Nov 21 '18 at 9:00










            • Have you seen scheduling feature?
              – matejko219
              Nov 21 '18 at 9:18










            • I know that.but it is not based on time exactly.it will be triggred based on some third party event
              – Sumit Ghosh
              Nov 21 '18 at 9:25
















            I cannot go with spring boot since my application is kind of a cron job application.It will be triggered by a third party app just like a batch job
            – Sumit Ghosh
            Nov 21 '18 at 9:00




            I cannot go with spring boot since my application is kind of a cron job application.It will be triggered by a third party app just like a batch job
            – Sumit Ghosh
            Nov 21 '18 at 9:00












            Have you seen scheduling feature?
            – matejko219
            Nov 21 '18 at 9:18




            Have you seen scheduling feature?
            – matejko219
            Nov 21 '18 at 9:18












            I know that.but it is not based on time exactly.it will be triggred based on some third party event
            – Sumit Ghosh
            Nov 21 '18 at 9:25




            I know that.but it is not based on time exactly.it will be triggred based on some third party event
            – Sumit Ghosh
            Nov 21 '18 at 9:25













            0














            maven-jar-plugin provides the capability to build jars without dependencies.
            To create jar with all it's dependencies you can use maven-assembly-plugin or maven-shade-plugin. Below is maven-assembly-plugin configuration in pom.xml:



            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
            <execution>
            <phase>package</phase>
            <goals>
            <goal>single</goal>
            </goals>
            <configuration>
            <archive>
            <manifest>
            <mainClass>
            fully.qualified.classpath.Main
            </mainClass>
            </manifest>
            </archive>
            <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>
            </configuration>
            </execution>
            </executions>
            </plugin>


            More information: executable-jar-with-maven






            share|improve this answer





















            • maven-shade-plugin solve the issue.but while running using java -jar option it gives a separate exception as follows:: Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 651; cvc-elt.1: Cannot find the declaration of element 'beans'.
              – Sumit Ghosh
              Nov 21 '18 at 8:45


















            0














            maven-jar-plugin provides the capability to build jars without dependencies.
            To create jar with all it's dependencies you can use maven-assembly-plugin or maven-shade-plugin. Below is maven-assembly-plugin configuration in pom.xml:



            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
            <execution>
            <phase>package</phase>
            <goals>
            <goal>single</goal>
            </goals>
            <configuration>
            <archive>
            <manifest>
            <mainClass>
            fully.qualified.classpath.Main
            </mainClass>
            </manifest>
            </archive>
            <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>
            </configuration>
            </execution>
            </executions>
            </plugin>


            More information: executable-jar-with-maven






            share|improve this answer





















            • maven-shade-plugin solve the issue.but while running using java -jar option it gives a separate exception as follows:: Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 651; cvc-elt.1: Cannot find the declaration of element 'beans'.
              – Sumit Ghosh
              Nov 21 '18 at 8:45
















            0












            0








            0






            maven-jar-plugin provides the capability to build jars without dependencies.
            To create jar with all it's dependencies you can use maven-assembly-plugin or maven-shade-plugin. Below is maven-assembly-plugin configuration in pom.xml:



            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
            <execution>
            <phase>package</phase>
            <goals>
            <goal>single</goal>
            </goals>
            <configuration>
            <archive>
            <manifest>
            <mainClass>
            fully.qualified.classpath.Main
            </mainClass>
            </manifest>
            </archive>
            <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>
            </configuration>
            </execution>
            </executions>
            </plugin>


            More information: executable-jar-with-maven






            share|improve this answer












            maven-jar-plugin provides the capability to build jars without dependencies.
            To create jar with all it's dependencies you can use maven-assembly-plugin or maven-shade-plugin. Below is maven-assembly-plugin configuration in pom.xml:



            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
            <execution>
            <phase>package</phase>
            <goals>
            <goal>single</goal>
            </goals>
            <configuration>
            <archive>
            <manifest>
            <mainClass>
            fully.qualified.classpath.Main
            </mainClass>
            </manifest>
            </archive>
            <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>
            </configuration>
            </execution>
            </executions>
            </plugin>


            More information: executable-jar-with-maven







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 21 '18 at 8:25









            Sukhpal SinghSukhpal Singh

            879110




            879110












            • maven-shade-plugin solve the issue.but while running using java -jar option it gives a separate exception as follows:: Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 651; cvc-elt.1: Cannot find the declaration of element 'beans'.
              – Sumit Ghosh
              Nov 21 '18 at 8:45




















            • maven-shade-plugin solve the issue.but while running using java -jar option it gives a separate exception as follows:: Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 651; cvc-elt.1: Cannot find the declaration of element 'beans'.
              – Sumit Ghosh
              Nov 21 '18 at 8:45


















            maven-shade-plugin solve the issue.but while running using java -jar option it gives a separate exception as follows:: Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 651; cvc-elt.1: Cannot find the declaration of element 'beans'.
            – Sumit Ghosh
            Nov 21 '18 at 8:45






            maven-shade-plugin solve the issue.but while running using java -jar option it gives a separate exception as follows:: Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 651; cvc-elt.1: Cannot find the declaration of element 'beans'.
            – Sumit Ghosh
            Nov 21 '18 at 8:45













            0














            Try this out inside your pom.xml file:



            <build>
            <plugins>
            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.8</version>
            <executions>
            <execution>
            <id>copy-dependencies</id>
            <phase>prepare-package</phase>
            <goals>
            <goal>copy-dependencies</goal>
            </goals>
            <configuration>
            <outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
            <includeScope>runtime</includeScope>
            </configuration>
            </execution>
            </executions>
            </plugin>
            </plugins>







            share|improve this answer


























              0














              Try this out inside your pom.xml file:



              <build>
              <plugins>
              <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-dependency-plugin</artifactId>
              <version>2.8</version>
              <executions>
              <execution>
              <id>copy-dependencies</id>
              <phase>prepare-package</phase>
              <goals>
              <goal>copy-dependencies</goal>
              </goals>
              <configuration>
              <outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
              <includeScope>runtime</includeScope>
              </configuration>
              </execution>
              </executions>
              </plugin>
              </plugins>







              share|improve this answer
























                0












                0








                0






                Try this out inside your pom.xml file:



                <build>
                <plugins>
                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
                <executions>
                <execution>
                <id>copy-dependencies</id>
                <phase>prepare-package</phase>
                <goals>
                <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                <outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
                <includeScope>runtime</includeScope>
                </configuration>
                </execution>
                </executions>
                </plugin>
                </plugins>







                share|improve this answer












                Try this out inside your pom.xml file:



                <build>
                <plugins>
                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
                <executions>
                <execution>
                <id>copy-dependencies</id>
                <phase>prepare-package</phase>
                <goals>
                <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                <outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
                <includeScope>runtime</includeScope>
                </configuration>
                </execution>
                </executions>
                </plugin>
                </plugins>








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 21 '18 at 8:51









                rod.poli.dinizrod.poli.diniz

                116118




                116118






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407728%2fmaven-build-not-exporting-dependent-librarys-for-packaging-type-jar%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Costa Masnaga

                    Fotorealismo

                    Sidney Franklin