Hi all!! :smile: i'm trying to run a script with d...
# scripting
g
Hi all!! 😄 i'm trying to run a script with dependencies.. here my script:
script.main.kts
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))
$: kotlinc -cp kotlin-main-kts-1.3.41.jar -script script.main.kts
Copy code
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))
      ^
i do not understand what's wrong here.. 😢
found the solution.. the kotlinc version it was different from the library.. updated to 1.3.41 and now works!
i
Could you, please, report it to the YouTrack (https://youtrack.jetbrains.com/issues/KT). Seems like we need at least better diagnostics here.
👍 1
g
i will do!! Thanks Ilya 🙂