Solved Odd maven error

Discussion in 'Spigot Plugin Development' started by Incrementing, Mar 16, 2016.

  1. So I was using NametagEdit.jar in my maven project but I've recently created my own way of editing nametags.
    NametagEdit was no longer need so I removed nametagedit.jar from the /libs dir and from the pom.xml file.

    But now I get the following when NametagEdit isn't on the server (works fine when its on the server) even though no class makes any calls to NametagEdit nor is it still a dependency in maven.

    Code (Text):
    [22:49:25 ERROR]: Could not pass event AsyncPlayerChatEvent to aresHub v1.0
        at$1.execute( ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.RegisteredListener.callEvent( ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.SimplePluginManager.fireEvent( [spigot.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.plugin.SimplePluginManager.callEvent( [spigot.jar:git-Spigot-db6de12-18fbb24]
        at [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.PlayerConnection.a( [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.PacketPlayInChat$ [spigot.jar:git-Spigot-db6de12-18fbb24]
        at java.util.concurrent.Executors$ [?:1.8.0_66-internal]
        at [?:1.8.0_66-internal]
        at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:1.8.0_66-internal]
        at java.util.concurrent.ThreadPoolExecutor$ [?:1.8.0_66-internal]
        at [?:1.8.0_66-internal]
    Caused by: java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariDataSource
        at ~[?:?]
        at ~[?:?]
        at ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66-internal]
        at sun.reflect.NativeMethodAccessorImpl.invoke( ~[?:1.8.0_66-internal]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:1.8.0_66-internal]
        at java.lang.reflect.Method.invoke( ~[?:1.8.0_66-internal]
        at$1.execute( ~[spigot.jar:git-Spigot-db6de12-18fbb24]
        ... 11 more
    Anyone got any ideas?
    I've tried recreating the maven project but still the same error.

    Update: pom is here sorry for not posting it before I'm an idiot.
    #1 Incrementing, Mar 16, 2016
    Last edited: Mar 17, 2016
  2. I don't think that's related to NametagEdit.
    So your problem is you're not shading Hikari in your jar. I don't use Maven but I'm pretty sure this would be useful: on the left of the link there's examples too
  3. Wow, it's maven... how can anybody help you without your pom?
  4. Updated post.
  5. Do what RaringM said.
  6. Will take a look at shading now.
    Sorry I'm new to maven :D
  7. You also need to remove the scope of the Hikari dependency. If you leave it as provided it won't shade into the plugin.
  8. I was just about to ask why the shaded jar didn't have a com packge in it :)
    Mind reader?

    Removing the Hikari dependency didn't work, the <dependencies> section just had to be above the <plugins> section.
    #8 Incrementing, Mar 17, 2016
    Last edited: Mar 17, 2016
    • Like Like x 1
  9. If anyone has a problem like this:
    Cause: It was working with nametagedit as the nametagedit.jar had Hikari shaded into it.
    Fix: I had to #Learn2Shade.
    Working pom.xml:

    Thanks for the help :)
    #9 Incrementing, Mar 17, 2016
    Last edited: Mar 17, 2016