Is it possible to import a class written inside a Kotlin file in a Jupiter notebook? If so, how? Also, considering this class calls a JVM library.
i
Ilya Muradyan
04/30/2022, 4:07 PM
If you have a directory containing compiled classes (like in classes directory after a project build), you may specify a path to this directory in DependsOn annotation, like it's done for other dependencies
👍 1
f
Filipe Duarte
04/30/2022, 6:03 PM
Now I can import the class I wrote but can not use it because of its dependencies. Then I imported the dependencies with maven @file:Repository()... But the error continues. So I can use the dependencies but not my custom class because the built folder does not contain a .class file for the dependencies
i
Ilya Muradyan
04/30/2022, 6:22 PM
Sure, .class files know nothing about their dependencies. You may include these dependencies manually using DependsOn. But general way is to publish an artifact, i.e. to local Maven repository. Artifact consists not only of jar where class files are located but it also contains pom.xml where dependencies are described. Syntax for including artifacts from maven local is:
@file:Repository ("*mavenLocal")
@file:DependsOn ("groupartifactIDversion")