[JAVA] Build Jar files in plugin folder with one click in IntelliJ

When developing plugins on Minecraft, I wanted to save a little time, so I will write a method to plug into the plugins of the server I want to use with one click.

environment

~~ Great ~~ Preface

Have you ever wondered why I (I) have to build each and then put the built jar file in the plugins file and reload it even though it's fine today? Quite a few developers should have thought.

Well, good news for you. Just press the green right triangle in the upper right to go through the whole process and try reload and depression in the console to try your best and greatest plugins! Let's go.

Build Artifact

basic configuration

1 ... Press File 2 ... Press Project Structure 3 ... See Project Settings 4 ... Press Artifacts intellij_1.png intellij_2.png

5 ... Press the plus button above 6 ... Press JAR ▶ Press 7 ... From modules with dependencies 8 ... ** If there is no particular difference from the image **, press OK [^ 1]

intellij_3.png intellij_4.png intellij_5.png

9 ... Press the plus button near the bottom of the Output Layout 10 ... Press File 11 ... Specify the path to the project \ src \ main \ resources \ plugin.yml 12 ... press OK 13 ... Set the server plugin folder in the Output Directory 14 ... press OK

intellij_5.png intellij_6.png intellij_7.png

Try Build Artifact

1 ... Press Build in the menu above 2 ... Press Build Artifacts 3 ... Press the Artifact you just created 4 ... Press Build

intellij_8.png intellij_9.png

You should now have a jar with the name of your plugin in your plugins file! I did it! Then run it on the server and test it.

Press the button to build to the specified directory

1 ... Press Sample Build in the upper right 2 ... Press Edit Configurations 3 ... Press the plus button on the top left 4 ... Press JAR Application 5-1 ... Change Name (optional) 5-2 ... Set Path to JAR to the path of the server jar 5-3 ... Make Working Directory the root of the server (the shallowest folder) 5-4 ... Set JRE to Default [^ 1] 5-5 ... Set Search sources using module's classpath to 6 ... Set the Artifact created earlier (check) 7 ... press OK

intellij_10.png intellij_11.png

After that, select the JAR Application you just created from the dropdown on the upper right, press the Run button, the server will start and the build will be loaded automatically!

Then everyone, have a good development life.

reference

https://www.spigotmc.org/threads/tip-one-click-artifact-build-and-spigot-server-start-in-intellij.308427/

[^ 1]: In some cases, the settings may change, so please adjust according to your environment.

Recommended Posts

Build Jar files in plugin folder with one click in IntelliJ
Combine system-scoped jar files into one with Maven Dependency Plugin
Set up Gradle multi-project in IntelliJ to build JAR file
About Stream Debugger in IntelliJ IDEA plugin
Combine system-scoped jar files into one with Maven Dependency Plugin
Build Jar files in plugin folder with one click in IntelliJ
Getting started with Gradle (until you create a Java project and combine external libraries into one executable JAR)
Getting started with Maven (until you create a Java project and combine external libraries into a single executable JAR)
Automate integration testing with Maven Failsafe plugin
How to output jar with main class specified by gradle in Intellij IDEA