Updated PlatformAbstraction layer

- Replace usage of DepDownloader with MVNLoader

Affects issues:
- Fixed #1839
This commit is contained in:
Risto Lahtela 2021-04-23 10:23:50 +03:00
parent c627e5b88e
commit b6f1bb22c8
7 changed files with 13 additions and 7 deletions

View File

@ -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"

View File

@ -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());
}
}

View File

@ -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());
}
}

View File

@ -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",

View File

@ -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());
}
}

View File

@ -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());
}
}

View File

@ -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());
}