Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

You should use the Maven Assembly plugin or the Maven Shade plugin.

The fact is that the JAR file format doesn't have native support for including dependencies inside itself (there's a 20-year old RFE logged for it). So you can achieve what you're asking for but it will always be some sort of workaround. For example you have to be careful about possible file name conflicts - that is something that the Shade plugin is trying to solve, the Assembly plugin is easier to use, IMHO, but will keep overwriting files.

Have a look at this example how to use the assembly plugin and how to deal with DLLs: Package Dll in Jar using Maven- single goalPackage Dll in Jar using Maven- single goal

You should use the Maven Assembly plugin or the Maven Shade plugin.

The fact is that the JAR file format doesn't have native support for including dependencies inside itself (there's a 20-year old RFE logged for it). So you can achieve what you're asking for but it will always be some sort of workaround. For example you have to be careful about possible file name conflicts - that is something that the Shade plugin is trying to solve, the Assembly plugin is easier to use, IMHO, but will keep overwriting files.

Have a look at this example how to use the assembly plugin and how to deal with DLLs: Package Dll in Jar using Maven- single goal

You should use the Maven Assembly plugin or the Maven Shade plugin.

The fact is that the JAR file format doesn't have native support for including dependencies inside itself (there's a 20-year old RFE logged for it). So you can achieve what you're asking for but it will always be some sort of workaround. For example you have to be careful about possible file name conflicts - that is something that the Shade plugin is trying to solve, the Assembly plugin is easier to use, IMHO, but will keep overwriting files.

Have a look at this example how to use the assembly plugin and how to deal with DLLs: Package Dll in Jar using Maven- single goal

added pointer to an example
Source Link
Jakub Kotowski
  • 7.6k
  • 1
  • 32
  • 38

You should use the Maven Assembly plugin or the Maven Shade plugin.

The fact is that the JAR file format doesn't have native support for including dependencies inside itself (there's a 20-year old RFE logged for it). So you can achieve what you're asking for but it will always be some sort of workaround. For example you have to be careful about possible file name conflicts - that is something that the Shade plugin is trying to solve, the Assembly plugin is easier to use, IMHO, but will keep overwriting files.

Have a look at this example how to use the assembly plugin and how to deal with DLLs: Package Dll in Jar using Maven- single goal

You should use the Maven Assembly plugin or the Maven Shade plugin.

The fact is that the JAR file format doesn't have native support for including dependencies inside itself (there's a 20-year old RFE logged for it). So you can achieve what you're asking for but it will always be some sort of workaround. For example you have to be careful about possible file name conflicts - that is something that the Shade plugin is trying to solve, the Assembly plugin is easier to use, IMHO, but will keep overwriting files.

You should use the Maven Assembly plugin or the Maven Shade plugin.

The fact is that the JAR file format doesn't have native support for including dependencies inside itself (there's a 20-year old RFE logged for it). So you can achieve what you're asking for but it will always be some sort of workaround. For example you have to be careful about possible file name conflicts - that is something that the Shade plugin is trying to solve, the Assembly plugin is easier to use, IMHO, but will keep overwriting files.

Have a look at this example how to use the assembly plugin and how to deal with DLLs: Package Dll in Jar using Maven- single goal

Source Link
Jakub Kotowski
  • 7.6k
  • 1
  • 32
  • 38

You should use the Maven Assembly plugin or the Maven Shade plugin.

The fact is that the JAR file format doesn't have native support for including dependencies inside itself (there's a 20-year old RFE logged for it). So you can achieve what you're asking for but it will always be some sort of workaround. For example you have to be careful about possible file name conflicts - that is something that the Shade plugin is trying to solve, the Assembly plugin is easier to use, IMHO, but will keep overwriting files.