Home > database >  How can I put all dependencies into one folder inside a JAR file with Maven?
How can I put all dependencies into one folder inside a JAR file with Maven?

Time:11-02

I'm using Maven and several libraries in my project, some of them are nested in the final JAR file.

The file structure inside the JAR file now looks like this:

jar
│
├───com
│   ├───feniksovich (my project)
│   └───zaxxer (hikari shaded lib directory)                 
│
├───org
│   ├───apache (commons-io shaded lib directory)
│   └───slf4j (slf4j shaded lib directory)
└───redis (jedis shaded lib directory)

Is it possible to make it look something like this?

jar
│
├───com
│   └───feniksovich (my project)               
│
└───libs
    ├───com
    │   └───zaxxer (hikari shaded lib directory)
    ├───org
    │   ├───apache (commons-io shaded lib directory)
    │   └───slf4j (slf4j shaded lib directory)
    └───redis (jedis shaded lib directory)

My current pom.xml: https://paste.lucko.me/fgMSBhCtpM

Thanks in advance.

CodePudding user response:

No.

The structure of the JAR needs to follow the names of the packages.

  • Related