I am trying to create a standalone jar file I don't think that maven package
is properly packaging my dependencies into the package. Is there a way to force it to include them?
Asked
Active
Viewed 5,882 times
6

chustar
- 12,225
- 24
- 81
- 119
-
What makes you think that `maven package` is incorrect? – Jeremy Aug 09 '11 at 21:18
-
1It didn't include all the dependencies that I needed – chustar Aug 12 '11 at 16:09
-
Future readers, this article helped me : https://www.mkyong.com/maven/create-a-fat-jar-file-maven-assembly-plugin/ – granadaCoder Jun 06 '19 at 15:07
4 Answers
6
Alternately you could use the jar-with-dependencies packaging of maven assembly plugin.

Raghuram
- 51,854
- 11
- 110
- 122
4
You need to use the shade plugin.
By default maven builds and packages the compile output from the current project. The shade plugin allows to you create an 'uber' jar that contains not just your code but all of the dependencies into a single (sometimes quite big) jar.
Optionally allows you to relocate classes in the packaging phase, meaning that your project can have completely private copies of it's dependencies without getting caught in jar hell.

Gareth Davis
- 27,701
- 12
- 73
- 106
0
Please check this answer https://stackoverflow.com/a/35359756/5678086 for creating full pack with all dependencies