How to add local jar as dependency? #1723
Unanswered
TheBoneJarmer
asked this question in
Q&A
Replies: 2 comments 1 reply
-
You Can use classpath to refer to jar files. Maven does provide ways to fetch based on OS but many also just bundles All and dynamcially choose which to load. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey, I tried that using the Any idea how to fix this? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, today I learned about jbang and so far I think it is incredible. But one thing is preventing me from using it for real though. I am in need of using a local jar file as dependency. And this is an absolute must for me.
Using javac I could simply set the classpath. And I assume I have to do that here too somehow. But I rather use the
//DEPS
directive for that. I tried doing something stupidly simple as//DEPS lib/myjar.jar
but it wont resolve.EDIT:
Also perhaps good to know is that the JAR file I speak of is the result of another project of mine. But I cannot simply push that one to maven as its actually a Java wrapper for a C++ library I created. And it has to be compiled per operating system and maven does not give a damn about that. I do not like pre-compiling a dozen .so/.dll files and include them per architecture and kernel because that is a bitch to maintain.
I use JNI to communicate between Java and C++. Therefore the Java wrapper has a build script instead because it needs to compile the native library part first using CMake and than the Java part using javac. And it has to do so in a very specific order. I was however considering using jbang to build the Java part and use the
//FILES
directive to include the .so/.dll file in the resulting JAR. Something I now do manually in bash.Beta Was this translation helpful? Give feedback.
All reactions