0

So I have a dependency and need to implement it into my .jar file (final export). Here's my build.graddle.kts: https://paste.md-5.net/mivovenaro.js

Here's the error I always run into: Caused by: java.lang.ClassNotFoundException: com.xef5000.vigilance.Vigilant

I understand the error, it means that it couldn't find the clas 'com.xef5000.vigilance.Vigilant', but I did declare it in my build.graddle.kts here:

tasks.shadowJar {
    archiveClassifier.set("") 
    relocate("gg.essential.vigilance", "com.xef5000.vigilance")
    // vigilance dependencies
    relocate("gg.essential.elementa", "com.xef5000.elementa")
    // elementa dependencies
    relocate("gg.essential.universalcraft", "com.xef5000.universalcraft")
    dependencies{
        include(dependency("org.spongepowered:mixin"))
    }
}
xef5000
  • 5
  • 2
  • [This](https://stackoverflow.com/a/56306032/1271785) suggests that you have to trigger the `shadowJar` task before building using `assemble.dependsOn shadowJar`. I can't attest to this because I haven't shadowed a jar. – pfurbacher Feb 28 '23 at 01:03
  • I have `assemble.dependsOn shadowJar` already. It didn't fix the issue – xef5000 Feb 28 '23 at 01:30
  • I didn't see that in your link -- that's one one the reasons you should post all code ***in*** your question (see [Why I shouldn’t upload images of code](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors/285557#285557) -- yes I know yours isn't an image, but it still requires leaving the question page). – pfurbacher Feb 28 '23 at 16:09
  • ok how do I trigger the shadowJar task before building ? – xef5000 Feb 28 '23 at 21:02

0 Answers0