while starting plugin for spigot server i have error when enabling HikariCP. I have Hikari shaded in my .jar. My pom.xml can be found here https://pastebin.com/3vpEzyig
[18:32:48] [Server thread/ERROR]: Error occurred while enabling PvPCraftFactions v1.0.0 (Is it up to date?)
java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariConfig
at com.massivecraft.factions.Settings.loadHikariConfig(Settings.java:411) ~[?:?]
at com.massivecraft.factions.Settings.load(Settings.java:491) ~[?:?]
at com.massivecraft.factions.P.loadSettings(P.java:197) ~[?:?]
at com.massivecraft.factions.P.onEnable(P.java:153) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [server.jar:git-Spigot-db6de12-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
Caused by: java.lang.ClassNotFoundException: com.zaxxer.hikari.HikariConfig
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_131]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[server.jar:git-Spigot-db6de12-18fbb24]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_131]
... 15 more
Thanks in advance
Remove the lines where your com.zaxxer.hikari
package relocation from maven's pom.xml so com/zaxxer/hikari/HikariConfig
(and other classes) will be recognized.
<relocation>
<pattern>com.zaxxer.hikari</pattern>
<shadedPattern>com.massivecraft.factions.shade.com.zaxxer.hikari</shadedPattern>
</relocation>
See also usage of refactoring imports when using shade relocations.