I am trying to add external jar files into my project in Intellij. I follow these steps: file->project structure->modules->dependencies->add jar or directory. However when it is done the location of that jar file is my local directory and when I build a project on a server it fails since there is no such directory for that jar on a server. How can I add a jar to the project without referencing a local directory?
Asked
Active
Viewed 162 times
1 Answers
0
You could deploy the entire project on the server as a uber JAR, meaning that the jar contains all of the dependent jars inside of it. You can accomplish that easily using maven shade, which is a simple plugin annotation in your .pom file (assuming you're using maven).
https://maven.apache.org/plugins/maven-shade-plugin/
There's a similar tool used in Gradle that is basically a port of the maven shade plugin. I've never used it before though, so I can't verify whether or not it is as easy to use or as effective.

K. W. H.
- 43
- 1
- 7
-
is there any way without deploying the entire project as jar file? – Oleksiy Kyrylenko Mar 12 '20 at 15:39