From b74496fb1529726ca120a1691d96e381e784ab7e Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Sun, 28 Nov 2021 18:17:10 +0100 Subject: [PATCH] Update to Spigot 1.18 api + Add legacy jar for 1.17 and previous --- README.md | 2 +- pom.xml | 45 +++++++++++-------- .../authme/events/EventsConsistencyTest.java | 7 ++- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 2820c0b10..7bd5a0350 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ You can also create your own translation file and, if you want, you can share it ## Requirements ##### Compiling requirements: ->- JDK 8 (JDK 11 is recommended) +>- JDK 8 (JDK 17 is recommended) >- Maven >- Git/Github (Optional) diff --git a/pom.xml b/pom.xml index d035696a4..04ce239a4 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 3.6.0 - 1.17.1-R0.1-SNAPSHOT + 1.18-rc3-R0.1-SNAPSHOT AuthMe @@ -290,17 +290,15 @@ shade - - @@ -326,7 +336,7 @@ Relocate all lib we use in order to fix class loading errors if we use different versions than already loaded libs --> - + ch.jalu fr.xephi.authme.libs.ch.jalu @@ -399,13 +409,10 @@ META-INF/*.SF META-INF/*.DSA META-INF/*.RSA - - - - *:* - + META-INF/*.RSA META-INF/*.MF META-INF/DEPENDENCIES + META-INF/**/module-info.class @@ -682,19 +689,19 @@ - + com.google.guava guava - 17.0 - provided + 31.0.1-jre + true - + com.google.code.gson gson - 2.2.4 - provided + 2.8.8 + true diff --git a/src/test/java/fr/xephi/authme/events/EventsConsistencyTest.java b/src/test/java/fr/xephi/authme/events/EventsConsistencyTest.java index fc96653b8..bb722d3ef 100644 --- a/src/test/java/fr/xephi/authme/events/EventsConsistencyTest.java +++ b/src/test/java/fr/xephi/authme/events/EventsConsistencyTest.java @@ -2,7 +2,6 @@ package fr.xephi.authme.events; import fr.xephi.authme.ClassCollector; import fr.xephi.authme.TestHelper; -import org.apache.commons.lang.reflect.MethodUtils; import org.bukkit.event.Event; import org.junit.BeforeClass; import org.junit.Test; @@ -49,7 +48,11 @@ public class EventsConsistencyTest { @Test public void shouldHaveStaticEventHandlerMethod() { for (Class clazz : classes) { - Method handlerListMethod = MethodUtils.getAccessibleMethod(clazz, "getHandlerList", new Class[]{}); + Method handlerListMethod = null; + try { + handlerListMethod = clazz.getMethod("getHandlerList"); + } catch (NoSuchMethodException ignored) { + } if (canBeInstantiated(clazz)) { assertThat("Class " + clazz.getSimpleName() + " has static method getHandlerList()", handlerListMethod != null && Modifier.isStatic(handlerListMethod.getModifiers()), equalTo(true));