This is a maven archetype ("template project") to quickly create a new Spigot plugin from scratch. See below on how to use it.
- Automatically creates a whole project setup including main class, plugin.yml and pom.xml
- Set a custom package name, main class name, plugin name, ...
- Set a custom Spigot version to use (e.g. "1.19.3")
- Choose whether you want to use NMS or not
- If you use NMS, it automatically adds the mojang mapping stuff to your pom.xml if using 1.17+
- Creates an "exportToServer" profile so you can deploy your .jar to your test server with one click
- Choose which dependencies you want to add, and automatically shade them when needed (JeffLib, Vault, CustomBlockData, MorePersistentDataTypes...)
- Optionally add a static instance getter to your main class
- ...and much more!
Option | Description | Default value |
---|---|---|
groupId |
The Maven Group ID of your plugin | |
artifactId |
The Maven Artifact ID of your plugin | |
version |
The version of your plugin | 1.0-SNAPSHOT |
pluginName |
The name of your plugin | |
package |
The main package name of your plugin | com.example.myplugin |
mainClass |
The name of your main class | MyPlugin |
description |
Your plugin's description | |
author |
The author of your plugin | Someone |
spigotVersion |
The Spigot version to use | 1.19.3 |
javaVersion |
The Java version to use, e.g. 8 or 17 | 8 |
pathToTestServer |
The path to your server (optional) | C:\mctest\plugins |
addStaticGetter |
Whether to add a static instance getter | false |
useKotlin |
Whether to use Kotlin instead of Java | false |
You can also automatically add the following dependencies. Allowed values are true
and false
. Default is false
for all.
Option | Dependency | Scope | Description |
---|---|---|---|
dependNMS |
Spigot (NMS) | Provided | Allows accessing CraftBukit and NMS classes + automatic remapping for 1.17+ |
dependLombok |
Lombok | Annotation | Annotation-based library to reduce boilerplate code |
dependJeffLib |
JeffLib | Shaded | General-purpose library |
dependVault |
Vault | Soft-Depend | Permissions, Chat & Economy API |
dependACF |
ACF | Shaded | Command framework |
dependMockBukkit |
MockBukkit | Test | Unit testing. Automatically creates an example test, too. |
dependMorePersistentDataTypes |
MorePersistentDataTypes | Shaded | More PersistentDataTypes + Collections, Maps & Arrays for PDC |
dependCustomBlockData |
CustomBlockData | Shaded | PDC for Blocks |
dependProtocolLib |
ProtocolLib | Soft-Depend | Packet sending & listening library |
dependWorldEdit |
WorldEdit | Soft-Depend | WorldEdit API |
dependWorldGuard |
WorldGuard | Soft-Depend | WorldGuard API (includes WorldEdit API) |
dependSpigotUpdateChecker |
SpigotUpdateChecker | Shaded | Powerful Update checker library |
dependTaskChain |
TaskChain | Shaded | Control Flow framework |
dependConfigurateGson |
Configurate-Gson | Shaded | Simple configuration library for JSON using Gson |
dependConfigurateHocon |
Configurate-HOCON | Shaded | Simple configuration library for HOCON |
dependConfigurateJackson |
Configurate-Jackson | Shaded | Simple configuration library for JSON using Jackson |
dependConfigurateXml |
Configurate-XML | Shaded | Simple configuration library for XML |
dependConfigurateYaml |
Configurate-YAML | Shaded | Simple configuration library for YAML |
dependRecordBuilder |
RecordBuilder | Annotation | RecordBuilder library |
dependAdventure |
Adventure-API | Shaded | Adventure API |
dependMiniMessage |
MiniMessage | Shaded | MiniMessage API (includes Adventure API) |
dependInventoryFramework |
IF (InventoryFramework) | Shaded | GUI library |
dependCirrus |
Cirrus | Shaded | GUI library |
You can use the Spigot-Plugin-Generator to use this archetype without having to install it locally. Simply download the Spigot-Plugin-Generator from the releases page and run it. It will automatically download the latest version of this archetype.
You simply have to clone this repo, then mvn install
it.
git clone https://github.com/JEFF-Media-GbR/maven-spigot-plugin
cd maven-spigot-plugin
mvn install
Then, you can create a new project using the archetype, either through your IDE or using the command line:
- Open IntelliJ
- Click
File
->New
->Project...
- Select
Maven Archetype
on the left - Choose
Default Local
in theCatalog
menu - Select
com.jeff-media:spigot-plugin
in theArchetype
menu. If this does not appear, click onAdd
, then entercom.jeff_media
as Group ID,spigot-plugin
as Artifact ID and1.0.0-SNAPSHOT
as Version. - Fill in the properties to your likings
You can either declare all properties that you want to change:
mvn archetype:generate \
-DarchetypeArtifactId=spigot-plugin \
-DarchetypeGroupId=com.jeff_media \
-DarchetypeVersion=1.0.0-SNAPSHOT \
-D<option>=<value> ...
Or you can use the interactive mode and make maven ask you for each property:
mvn archetype:generate \
-DaskForDefaultPropertyValues=true \
-DarchetypeArtifactId=spigot-plugin \
-DarchetypeGroupId=com.jeff_media \
-DarchetypeVersion=1.0.0-SNAPSHOT
Add SpigotUpdateChecker dependencyAdd WorldEdit / WorldGuard dependencyAdd ProtocolLibAdd Lombok- Add PaperLib