0

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?

1 Answers1

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.

https://github.com/johnrengelman/shadow

K. W. H.
  • 43
  • 1
  • 7