Hello everyone!! i have a problem executing a scri...
# announcements
g
Hello everyone!! i have a problem executing a script with dependencies: here my script file:
Copy code
@file:Repository("<https://repo1.maven.org/maven2>")
@file:DependsOn("org.apache.commons:commons-text:1.6")

import org.jetbrains.kotlin.script.util.DependsOn
import org.jetbrains.kotlin.script.util.Repository

import org.apache.commons.text.WordUtils

val hello = "helloWorld"
print(hello)
print(WordUtils.capitalize(hello))
then i execute the script:
Copy code
kotlinc -cp /usr/local/lib/danger/kotlin-main-kts.jar -script script.main.kts
script.main.kts:7:12: error: unresolved reference: apache
import org.apache.commons.text.WordUtils
           ^
script.main.kts:11:7: error: unresolved reference: WordUtils
print(WordUtils.capitalize(hello))
      ^
basically doesn't resolve the dependencies 😕 and i don't want to link directly the jar when executing the script
s
#scripting might be of more help