https://kotlinlang.org logo
#announcements
Title
# announcements
g

gianluz

06/29/2019, 3:48 PM
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

Shawn

06/29/2019, 11:44 PM
#scripting might be of more help
8 Views