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?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.