Maven External Dependency not found by Spigot (ClassNotFoundException)

Discussion in 'Spigot Plugin Development' started by _robert, Oct 12, 2019.

  1. Hi all, I am new to maven. I need this external api during compile time and runtime (where it will not be provided like spigot would be).

    According to this: The scope: compile tag should allow use during runtime, but I still get a java.lang.NoClassDefFoundError when trying to run. My relevant pom.xml:

    Code (Text):
    Thanks for any help.
  2. You have to shade the dependency into your JAR.
  3. Thank you. Do you have an example I can see, I tried adding this:

    Code (Text):
    But it did not work.
  4. Your POM looks correct. Did you see anything wrong in the build log?
  5. Spelling mistake, thanks for the help!
  6. fyi, the compile scope is default, so there’s no need to explicitly define it for a dependency.