I’m trying to use Kotlin in Datalore, and I’d like to be able to add a private Maven repository for some dependencies that are not publicly available. I have username/token for https basic authentication, but I can’t seem to figure out what is the right syntax for declaring a @Repository with authentication?
Kotlin Jupyter kernel uses Kotlin script resolver for Maven dependencies. Thus, it requires a support for private Maven repos in Kotlin scripts, which is currently non-implemented. You can track the progress of that feature here and as soon as it is done, we will ask Kotlin Jupyter team to support it in the kernel.
P.S. Sorry for the late answer!
If I set up a Jupyter notebook on my desktop with the Kotlin kernel, I can load dependencies from mavenLocal.
Is it feasible to upload a maven local repo to Datalore as an alternative? Is there any good guidance on getting that set up with the correct paths?
Basically, there are two ways:
- If you have built jars you can just upload them to the Attached Files and just depend on the jars directly:
- If you want to stick to the approach with local Maven, you can upload the needed packages as they are in your local Maven repository (preserving file structure) to the Attached Files and use:
And then depend on the packages the usual way by providing Maven coordinates.
Thank you for the suggestions and help, I really appreciate it. I’ll be giving these a try and will let you know if I have any other questions. But I think this will unblock me for now.
I was able to get this working with a fat JAR. It was a bit of a pain to set up, although I thought I’d share the solution in case it helps others.
I created a new gradle module to pull in my dependencies and relies on the Shadow plugin to merge everything together. The trick was excluding transitive dependencies, so they don’t get included in the JAR. The build.gradle.kts looks something like this:
// exclude things available within the Kotlin notebook environment