Hey all,
my plugin relies on the Apache Commons Math Library. I’ve edited my build.gradle file to declare these dependencies:
apply plugin: 'java'
apply plugin: 'maven'
group = 'net.kevinmendoza.geoworldlibrary'
version = '0.0.1-SNAPSHOT'
description = 'GeoWorld Library'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven {
name = 'sponge'
url = 'http://repo.spongepowered.org/maven'
}
maven {
name = 'commons-math3'
url = 'https://mvnrepository.com/artifact/org.apache.commons/commons-math3'
}
}
dependencies {
compile 'org.spongepowered:spongeapi:5.0.0'
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
}
However, when I call the section of my code which relies on the library, I get the following noClassDefFoundError:
[17:54:31] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Exception generating new chunk
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:704) ~[MinecraftServer.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:387) ~[ld.class:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:613) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471) [MinecraftServer.class:?]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/math3/geometry/euclidean/threed/Rotation
at net.kevinmendoza.geoworldlibrary.proceduralgeneration.shapes.Shape.initEmptyRotation(Shape.java:37) ~[Shape.class:?]
at net.kevinmendoza.geoworldlibrary.proceduralgeneration.shapes.Shape.<init>(Shape.java:32) ~[Shape.class:?]
at net.kevinmendoza.geoworldlibrary.proceduralgeneration.shapes.Shape2D.<init>(Shape2D.java:24) ~[Shape2D.class:?]
at net.kevinmendoza.geoworldlibrary.proceduralgeneration.shapes.Ellipse.<init>(Ellipse.java:20) ~[Ellipse.class:?]
at net.kevinmendoza.geoworldlibrary.proceduralgeneration.shapes.RegionFactory.MakeEllipse(RegionFactory.java:14) ~[RegionFactory.class:?]
I’m fairly sure this is because the Rotation.class file defined in the commons math library isn’t actually around during runtime, but I don’t know enough about the runtime vs compile time side of devops to say for sure. In any case, is there something else I need to do within my build.gradle?