#Depency ConfigUpdater

1 messages · Page 1 of 1 (latest)

median kelp
#

Im trying to import a library called ConfigUpdater, the problem is that even if there aren't problems (i defined it in the pom.xml and made no errors), when i load the plugin it give me the error: java.lang.NoClassDefFoundError

Thats the full error:

Error occurred while enabling temporary v1.0.0 (Is it up to date?)
java.lang.NoClassDefFoundError: com/tchristofferson/configupdater/ConfigUpdater
at me.brexx.temporary.Main.onEnable(Main.java:45) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:539) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugins(CraftServer.java:453) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:587) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:412) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:250) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:973) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:301) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3669-Spigot-454acb7-f150cfb]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: com.tchristofferson.configupdater.ConfigUpdater
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:147) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
... 12 more

and thats the pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.brexx.temporary</groupId>
<artifactId>temporary</artifactId>
<version>1.0.0</version>
<name>Temporary</name>
<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>maven-central</id>
<url>https://oss.sonatype.org/content/groups/public</url>
</repository>
</repositories>

<dependencies>
<!--This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.tchristofferson</groupId>
<artifactId>ConfigUpdater</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

tall ferry
#

You need to shade it

#

or use the libraries feature if it's in maven central

median kelp
#

i tried, maybe im doing it wrong

tall ferry
#

Show us what you tried

median kelp
#

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<artifactSet>
<includes>
<include>com.tchristofferson:ConfigUpdater</include>
</includes>
</artifactSet>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

#

i added this to the pom.xml to shade, but no changes

tall ferry
#

Also make sure to use the correct jar since it will create multiple

#

The shaded pattern should be inside your package

median kelp
tall ferry
#

?

#

The one you use is the one you put in the plugins folder

#

So only put the jar that doesn't end with -shaded or -original

median kelp
#

aahh yeahyeah

#

im using eclipse, i could share the package with eclipse right?

tall ferry
#

Don't use eclipses package name for your plugin

median kelp
tall ferry
#

other than that, try it and see

median kelp
#

again the same error

tall ferry
#

Could you send the jar

median kelp
#

idk what to try anymore

tall ferry
#

You're not even using maven to compile ._.

#

Use maven and it should work fine

median kelp
#

but the file that i compile with maven doesnt have the plugin.yml

tall ferry
#

Did you put it in the resources folder?

median kelp
#

what?

#

its the first time that im using maven

tall ferry
#

I can tell

median kelp
#

do i have to change something in the build part?

tall ferry
#

src/main/resources

#

put the plugin.yml there

median kelp
#

okk it works now