Add options docs and default acceptEula to false

This commit is contained in:
2026-05-23 23:53:54 +02:00
parent 37254a60f0
commit dd9d263a07
2 changed files with 49 additions and 3 deletions
+1 -2
View File
@@ -6,7 +6,6 @@
<component name="ChangeListManager">
<list default="true" id="98c311c3-6130-4449-9bcb-07029b56b776" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/org/strassburger/mcrun/RunServerMojo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/org/strassburger/mcrun/RunServerMojo.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@@ -55,7 +54,7 @@
<updated>1779565206518</updated>
<workItem from="1779565207730" duration="57000" />
<workItem from="1779565274563" duration="632000" />
<workItem from="1779565913273" duration="6820000" />
<workItem from="1779565913273" duration="7278000" />
</task>
<servers />
</component>
@@ -18,30 +18,77 @@ import java.util.List;
@Mojo(name = "run", defaultPhase = LifecyclePhase.PACKAGE)
public class RunServerMojo extends AbstractMojo {
/**
* Path to the plugin jar to deploy. Defaults to the project's build output jar.
* Override if your jar is assembled elsewhere or has a classifier.
*/
@Parameter(defaultValue = "${project.build.directory}/${project.build.finalName}.jar")
private File pluginJar;
/**
* Directory where the test server will be created and run.
* The server jar, plugins folder, and all generated files (eula.txt, world, logs, etc.)
* will be placed here. Defaults to <code>${project.basedir}/server</code>.
*/
@Parameter(defaultValue = "${project.basedir}/server")
private File serverDirectory;
/**
* File name for the downloaded or provided server jar, relative to {@code serverDirectory}.
* Defaults to <code>server.jar</code>.
*/
@Parameter(defaultValue = "server.jar")
private String serverJarName;
/**
* The server software to download. Defaults to <code>paper</code>.
* Can be one <code>paper</code> or <code>spigot</code>.
*/
@Parameter(defaultValue = "paper")
private String serverSoftware;
/**
* The Minecraft version to run, e.g. <code>1.21.4</code>. Required.
*/
@Parameter(required = true)
private String mcVersion;
/**
* Heap size passed to both {@code -Xmx} and {@code -Xms}.
* Accepts standard JVM memory notation, e.g. <code>2G</code>, <code>512M</code>.
* Defaults to <code>2G</code>.
*/
@Parameter(defaultValue = "2G")
private String memory;
@Parameter(defaultValue = "true")
/**
* When {@code true}, automatically creates {@code eula.txt} with {@code eula=true}
* in the server directory if it does not already exist, bypassing the manual
* acceptance step. Defaults to {@code false}.
*
* <p>By setting this to {@code true} you are indicating that you accept the
* <a href="https://aka.ms/MinecraftEULA">Minecraft End User License Agreement</a>.</p>
*/
@Parameter(defaultValue = "false")
private boolean acceptEula;
/**
* Additional JVM arguments to pass to the server process.
* These are inserted after -Xmx/-Xms and before -jar.
*
* <pre>{@code
* <jvmArgs>
* <arg>-XX:+UseG1GC</arg>
* <arg>-XX:+ParallelRefProcEnabled</arg>
* </jvmArgs>
* }</pre>
*/
@Parameter
private List<String> jvmArgs = new ArrayList<>();
/**
* The port the Minecraft server will listen on. Passed to the server via --port.
*/
@Parameter
private Integer port;