Support local jar references in @file:DependsOn
See original GitHub issueI’m struggling to understand how I’m supposed to get access to my local libraries in kscript. I have simple file :
#! /usr/bin/env kscript
import se.explodera.util.sql.OracleDBFileLoader
println("Hello.")
where the imported class can be found in a jar file on the environment classpath. But when I run the script I get the message
error: unresolved reference: se
import se.explodera.util.sql.OracleDBFileLoader
Do I really have to add my local jar file to a maven repository?
When I try to print the classpath from within my code it seems to be limited to kotlin-runner.jar
. Is this by design, or am I doing something wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:24 (6 by maintainers)
Top Results From Across the Web
Support local jar references in @file:DependsOn #302 - GitHub
I'm struggling to understand how I'm supposed to get access to my local libraries in kscript. I have simple file : #! /usr/bin/env...
Read more >How to add local jar files to a Maven project? - Stack Overflow
The best option for having local JAR files as a dependency is to create a local Maven repository. Such a repository is nothing...
Read more >Local JAR Files as Gradle Dependencies | Baeldung
Learn how we can add local JAR files to our Gradle dependencies. ... The canonical reference for building a production grade API with...
Read more >Location-Independent Access to Resources
Localized resources are supported by the internationalization facilities. ... The ClassLoader methods search each directory, ZIP file, or JAR file entry in ...
Read more >Kotlin with OpenCV 4.10 on macOS terminal - Support
kotlinc test-opencv.kt -classpath /usr/local/opt/opencv/share/java/opencv4/opencv-410.jar -include-runtime -d test-opencv.jar. I get the jar ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Indeed it’s suboptimal from a user experience perspective. I’ve changed the title to reflect the idea better. I guess it should be addressed eventually by either extending the existing
DependsOn
annotation or by adding a new one. PRs are welcome.Great that you want to take on this task - I appreciate that!
src/test/kotlin/io/github/kscripting/kscript - here you can find unit tests. maybe e.g. recursive reading of jar/aar files can be tested here. /integration/kotlin/io/github/kscripting/kscript/integration - all the integration tests have its home in this directory; most probably those tests will be more important to fully test the feature.
Just prepare a first version of PR - I will have a look at it, and advice how to proceed if needed.