From b6f1bb22c8e47d7a952eb22bbbe514370129c758 Mon Sep 17 00:00:00 2001 From: Risto Lahtela <24460436+AuroraLS3@users.noreply.github.com> Date: Fri, 23 Apr 2021 10:23:50 +0300 Subject: [PATCH] Updated PlatformAbstraction layer - Replace usage of DepDownloader with MVNLoader Affects issues: - Fixed #1839 --- Plan/build.gradle | 2 +- Plan/bukkit/src/main/java/com/djrapitops/plan/Plan.java | 3 ++- .../src/main/java/com/djrapitops/plan/PlanBungee.java | 3 ++- .../src/main/java/com/djrapitops/plan/DependencyStartup.java | 3 ++- Plan/nukkit/src/main/java/com/djrapitops/plan/PlanNukkit.java | 3 ++- Plan/sponge/src/main/java/com/djrapitops/plan/PlanSponge.java | 3 ++- .../src/main/java/com/djrapitops/plan/PlanVelocity.java | 3 ++- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Plan/build.gradle b/Plan/build.gradle index 3910d1ff2..3987e271e 100644 --- a/Plan/build.gradle +++ b/Plan/build.gradle @@ -66,7 +66,7 @@ subprojects { ext.daggerVersion = "2.35" ext.daggerCompilerVersion = "2.35" - ext.palVersion = "4.0.13" + ext.palVersion = "4.1.0" ext.bukkitVersion = "1.13.2-R0.1-SNAPSHOT" ext.spigotVersion = "1.13.2-R0.1-SNAPSHOT" diff --git a/Plan/bukkit/src/main/java/com/djrapitops/plan/Plan.java b/Plan/bukkit/src/main/java/com/djrapitops/plan/Plan.java index 285fa92bf..8fba145fd 100644 --- a/Plan/bukkit/src/main/java/com/djrapitops/plan/Plan.java +++ b/Plan/bukkit/src/main/java/com/djrapitops/plan/Plan.java @@ -29,6 +29,7 @@ import net.playeranalytics.plugin.BukkitPlatformLayer; import net.playeranalytics.plugin.PlatformAbstractionLayer; import net.playeranalytics.plugin.scheduling.RunnableFactory; import net.playeranalytics.plugin.server.PluginLogger; +import org.apache.maven.model.building.ModelBuildingException; import org.bukkit.Bukkit; import org.bukkit.command.PluginCommand; import org.bukkit.configuration.file.FileConfiguration; @@ -65,7 +66,7 @@ public class Plan extends JavaPlugin implements PlanPlugin { try { new DependencyStartup(pluginLogger, abstractionLayer.getDependencyLoader()).loadDependencies(); - } catch (IOException e) { + } catch (IOException | ModelBuildingException e) { getLogger().log(Level.SEVERE, e, () -> this.getClass().getSimpleName()); } } diff --git a/Plan/bungeecord/src/main/java/com/djrapitops/plan/PlanBungee.java b/Plan/bungeecord/src/main/java/com/djrapitops/plan/PlanBungee.java index 5dd99c51b..c5a25c5e7 100644 --- a/Plan/bungeecord/src/main/java/com/djrapitops/plan/PlanBungee.java +++ b/Plan/bungeecord/src/main/java/com/djrapitops/plan/PlanBungee.java @@ -28,6 +28,7 @@ import net.playeranalytics.plugin.BungeePlatformLayer; import net.playeranalytics.plugin.PlatformAbstractionLayer; import net.playeranalytics.plugin.scheduling.RunnableFactory; import net.playeranalytics.plugin.server.PluginLogger; +import org.apache.maven.model.building.ModelBuildingException; import java.io.IOException; import java.io.InputStream; @@ -56,7 +57,7 @@ public class PlanBungee extends Plugin implements PlanPlugin { try { new DependencyStartup(logger, abstractionLayer.getDependencyLoader()).loadDependencies(); - } catch (IOException e) { + } catch (IOException | ModelBuildingException e) { getLogger().log(Level.SEVERE, e, () -> this.getClass().getSimpleName()); } } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/DependencyStartup.java b/Plan/common/src/main/java/com/djrapitops/plan/DependencyStartup.java index d864bf8b0..0732e21d5 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/DependencyStartup.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/DependencyStartup.java @@ -20,6 +20,7 @@ import com.djrapitops.plan.utilities.java.Lists; import net.playeranalytics.plugin.dependencies.DependencyLoader; import net.playeranalytics.plugin.me.lucko.jarrelocator.Relocation; import net.playeranalytics.plugin.server.PluginLogger; +import org.apache.maven.model.building.ModelBuildingException; import java.io.IOException; import java.util.Collections; @@ -35,7 +36,7 @@ public class DependencyStartup { this.dependencyLoader = dependencyLoader; } - public void loadDependencies() throws IOException { + public void loadDependencies() throws IOException, ModelBuildingException { logger.info("Resolving runtime dependencies.."); dependencyLoader.addDependency(REPOSITORY_MAVEN_CENTRAL, "com.h2database", "h2", "1.4.199", diff --git a/Plan/nukkit/src/main/java/com/djrapitops/plan/PlanNukkit.java b/Plan/nukkit/src/main/java/com/djrapitops/plan/PlanNukkit.java index 0c4dbd898..af1000b3d 100644 --- a/Plan/nukkit/src/main/java/com/djrapitops/plan/PlanNukkit.java +++ b/Plan/nukkit/src/main/java/com/djrapitops/plan/PlanNukkit.java @@ -33,6 +33,7 @@ import net.playeranalytics.plugin.NukkitPlatformLayer; import net.playeranalytics.plugin.PlatformAbstractionLayer; import net.playeranalytics.plugin.scheduling.RunnableFactory; import net.playeranalytics.plugin.server.PluginLogger; +import org.apache.maven.model.building.ModelBuildingException; import java.io.IOException; import java.util.Arrays; @@ -70,7 +71,7 @@ public class PlanNukkit extends PluginBase implements PlanPlugin { try { new DependencyStartup(logger, abstractionLayer.getDependencyLoader()).loadDependencies(); - } catch (IOException e) { + } catch (IOException | ModelBuildingException e) { Logger.getGlobal().log(Level.SEVERE, e, () -> this.getClass().getSimpleName()); } } diff --git a/Plan/sponge/src/main/java/com/djrapitops/plan/PlanSponge.java b/Plan/sponge/src/main/java/com/djrapitops/plan/PlanSponge.java index ed541ed5f..0cf5b52fe 100644 --- a/Plan/sponge/src/main/java/com/djrapitops/plan/PlanSponge.java +++ b/Plan/sponge/src/main/java/com/djrapitops/plan/PlanSponge.java @@ -28,6 +28,7 @@ import net.playeranalytics.plugin.PlatformAbstractionLayer; import net.playeranalytics.plugin.SpongePlatformLayer; import net.playeranalytics.plugin.scheduling.RunnableFactory; import net.playeranalytics.plugin.server.PluginLogger; +import org.apache.maven.model.building.ModelBuildingException; import org.bstats.sponge.Metrics; import org.slf4j.Logger; import org.spongepowered.api.Game; @@ -118,7 +119,7 @@ public class PlanSponge implements PlanPlugin { runnableFactory = abstractionLayer.getRunnableFactory(); try { new DependencyStartup(logger, abstractionLayer.getDependencyLoader()).loadDependencies(); - } catch (IOException e) { + } catch (IOException | ModelBuildingException e) { java.util.logging.Logger.getGlobal().log(Level.SEVERE, e, () -> this.getClass().getSimpleName()); } } diff --git a/Plan/velocity/src/main/java/com/djrapitops/plan/PlanVelocity.java b/Plan/velocity/src/main/java/com/djrapitops/plan/PlanVelocity.java index 08634d02d..b24fe4384 100644 --- a/Plan/velocity/src/main/java/com/djrapitops/plan/PlanVelocity.java +++ b/Plan/velocity/src/main/java/com/djrapitops/plan/PlanVelocity.java @@ -33,6 +33,7 @@ import net.playeranalytics.plugin.PlatformAbstractionLayer; import net.playeranalytics.plugin.VelocityPlatformLayer; import net.playeranalytics.plugin.scheduling.RunnableFactory; import net.playeranalytics.plugin.server.PluginLogger; +import org.apache.maven.model.building.ModelBuildingException; import org.bstats.velocity.Metrics; import org.slf4j.Logger; @@ -97,7 +98,7 @@ public class PlanVelocity implements PlanPlugin { try { new DependencyStartup(logger, abstractionLayer.getDependencyLoader()).loadDependencies(); - } catch (IOException e) { + } catch (IOException | ModelBuildingException e) { java.util.logging.Logger.getGlobal().log(Level.SEVERE, e, () -> this.getClass().getSimpleName()); }