diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..dbc49db
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,13 @@
+# Changelog
+All notable changes to this project will be documented in this file.
+
+## [1.0.3] - 2021-11-25
+### Changed
+- Update Paper Download Api to v2
+
+## [1.0.2] - 2020-10-05
+### Added
+- Add Config Option for Server Gui
+
+[1.0.3]: https://github.com/garrus-de/minecraft-server-plugin/releases/tag/1.0.3
+[1.0.2]: https://github.com/garrus-de/minecraft-server-plugin/releases/tag/1.0.2
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 10136ff..877bfe4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,10 +7,10 @@
de.garrus.maven
minecraft-server-plugin
maven-plugin
- 1.0.1
+ 1.0.3
minecraft-server-launcher
Maven Plugin to launch an Server for Plugin Development.
- https://github.com/MEGarrusVakarian/minecraft-server-plugin
+ https://github.com/garrus-de/minecraft-server-plugin/
@@ -24,15 +24,15 @@
The MIT License (MIT)
- hhttp://opensource.org/licenses/MIT
+ https://opensource.org/licenses/MIT
repo
- scm:git:git://git@github.com:MEGarrusVakarian/minecraft-server-plugin.git
- scm:git:git@github.com:MEGarrusVakarian/minecraft-server-plugin.git
- https://github.com/MEGarrusVakarian/minecraft-server-plugin
+ scm:git:git@github.com:garrus-de/minecraft-server-plugin.git
+ scm:git:git@github.com:garrus-de/minecraft-server-plugin.git
+ https://github.com/garrus-de/minecraft-server-plugin/
@@ -44,12 +44,13 @@
3.1.1
1.5
1.6.7
+ 3.8.1
3.6.0
3.8.1
- 2.8.6
- 2.6
+ 2.8.9
+ 2.7
diff --git a/readme.md b/readme.md
index 357fed8..d3c4290 100644
--- a/readme.md
+++ b/readme.md
@@ -1,4 +1,4 @@
-# Minecraft Server Plugin [![Build Status](https://travis-ci.com/MEGarrusVakarian/minecraft-server-plugin.svg?branch=master)](https://travis-ci.com/MEGarrusVakarian/minecraft-server-plugin) [![Maven Central](https://img.shields.io/maven-central/v/de.garrus.maven/minecraft-server-plugin.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22de.garrus.maven%22%20AND%20a:%22minecraft-server-plugin%22)
+# Minecraft Server Plugin [![Maven Central](https://img.shields.io/maven-central/v/de.garrus.maven/minecraft-server-plugin.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22de.garrus.maven%22%20AND%20a:%22minecraft-server-plugin%22)
Maven Plugin to launch an Server for Plugin Development.
@@ -9,9 +9,9 @@ __Notice__: Current only [Papermc](http://papermc.io) Server supported.
de.garrus.maven
minecraft-server-plugin
- 1.0.2
+ 1.0.3
- 1.16.3
+ 1.17.1
true
true
diff --git a/src/main/java/de/garrus/maven/minecraftserverplugin/mojo/InstallMojo.java b/src/main/java/de/garrus/maven/minecraftserverplugin/mojo/InstallMojo.java
index 4239792..9f976ff 100644
--- a/src/main/java/de/garrus/maven/minecraftserverplugin/mojo/InstallMojo.java
+++ b/src/main/java/de/garrus/maven/minecraftserverplugin/mojo/InstallMojo.java
@@ -1,6 +1,7 @@
package de.garrus.maven.minecraftserverplugin.mojo;
import com.google.gson.Gson;
+import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import de.garrus.maven.minecraftserverplugin.ServerType;
import org.apache.commons.io.FileUtils;
@@ -15,7 +16,7 @@
@Mojo(name = "server-install", requiresOnline = true)
public class InstallMojo extends AbstractMojo {
- private static final String PAPER_API = "https://papermc.io/api/v1/paper/";
+ private static final String PAPER_API = "https://papermc.io/api/v2/projects/paper/versions/";
/**
* The Server type (PAPER,SPIGOT,BUKKIT)
@@ -185,9 +186,17 @@ public URL getPaperServerDownload() {
JsonObject versionJson = new Gson().fromJson(new InputStreamReader(paperApiURL.openStream()), JsonObject.class);
if (versionJson.has("builds")) {
- String buildVersion = versionJson.get("builds").getAsJsonObject().get("latest").getAsString();
-
- return new URL(PAPER_API + serverVersion + "/" + buildVersion + "/download");
+ // Store arr, save on some memory;
+ JsonArray arr = versionJson.get("builds").getAsJsonArray();
+
+ // Find latest build, from arr.size-1
+ String buildVersion = arr.get(arr.size()-1).toString();
+
+ // Show us where the jar is coming from
+ System.out.println("Getting jar from: "+PAPER_API + serverVersion + "/builds/" + buildVersion + "/downloads/"+"paper-"+serverVersion+"-"+buildVersion+".jar");
+
+ // Return jar url and do work
+ return new URL(PAPER_API + serverVersion + "/builds/" + buildVersion + "/downloads/"+"paper-"+serverVersion+"-"+buildVersion+".jar");
} else {
getLog().error("Can't find the build version in the api json");
return null;
diff --git a/src/main/java/de/garrus/maven/minecraftserverplugin/mojo/StartMojo.java b/src/main/java/de/garrus/maven/minecraftserverplugin/mojo/StartMojo.java
index 14c5bb8..706c7a3 100644
--- a/src/main/java/de/garrus/maven/minecraftserverplugin/mojo/StartMojo.java
+++ b/src/main/java/de/garrus/maven/minecraftserverplugin/mojo/StartMojo.java
@@ -11,6 +11,8 @@
import java.io.File;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
@Mojo(name = "server-start")
public class StartMojo extends AbstractMojo {
@@ -31,14 +33,17 @@ public class StartMojo extends AbstractMojo {
@Parameter(name = "targetFolder", readonly = true, defaultValue = "${project.build.directory}")
private File targetFolder;
- @Parameter(name = "skipPluginCopy",defaultValue = "false")
+ @Parameter(name = "skipPluginCopy", defaultValue = "false")
private boolean skipPluginCopy;
+ @Parameter(name = "gui", defaultValue = "false")
+ private boolean gui;
+
private File serverFile;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
- serverFile = new File(serverFolder, "server.jar");
+ serverFile = new File(serverFolder, "server.jar");
if (serverFile.exists()) {
@@ -72,8 +77,15 @@ private void copyPluginToServer() throws MojoFailureException {
* start the Spigot/Paper/Bukkit server as {@link Process} form maven
*/
private void startServer() {
+ List command = new ArrayList<>();
+ command.add("java");
+ command.add("-jar");
+ command.add("server.jar");
+ if (!gui) {
+ command.add("nogui");
+ }
try {
- ProcessBuilder processBuilder = new ProcessBuilder("java", "-jar", "server.jar", "nogui");
+ ProcessBuilder processBuilder = new ProcessBuilder(command);
processBuilder.directory(serverFolder);
processBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);