Guide - How to auto-export your plugin

May 9, 2018
Guide - How to auto-export your plugin
  • Hello Spigot Commiunity! I have seen a lot threads like ~Auto Export in Eclipse~, but none was really easy to understand. So, I hope this one will help you! So, you have your project wich looks like that:

    [​IMG]
    So, we'll begin with STEP 1
    1. Create a new XML-File in the SRC-Folder:
      1. Right-click on the SRC-Folder
      2. NEW --> OTHER... --> XML --> XML-File
      3. Set name to "Build.xml", Press OK
    This is the "Script" which will export your Project!

    2. Paste this into the File:

    Code (Text):
    <?xml version="1.0" ?>
    <project name="AutoExport" default="CreateJar">
      <property name="plugins" location="C://Users/yourUser/Desktop/minecraftserver/plugins"  />
      <target name="deleteFile">
          <delete file="${plugins}/NAME_OF_JAR.jar"/>
      </target>

      <target name="CreateJar" description="Create Jar file" depends = "deleteFile">
           <jar jarfile="${plugins}/NAME_OF_JARl.jar" basedir="" includes="*.yml, */*.*"/>
      </target>
    </project>

    7. Change NAME_OF_JAR & "C://Users/yourUser/Desktop/minecraftserver/plugins" to your "needs"
    (The Name of the .Jar file which wil be created and the path of your plugin-folder)
    Now, STEP 2
    1. Right-click your Project (Project)
    2. Click on PROPERTIES
    3. Go to "Builders"
    4. Click on NEW... ---> ANT BUILDER
    5. At BUILDFILE, click on BROWSE WORKSPACE
    6. Go to YOUR PROJECT and click on SRC
    7. Select the BUILD.XML file we just created and click OK
    8. Go to the tab TARGETS
    9. Behind AUTO BUILD, click SET TARGETS...
    10. check DELETEFILE and CREATEJAR
    11. Click on ORDER... and make sure that DELETEFILE is at the top. Now, press OK, OK, OK.
    When you now save your project, it will be exported automaticly!
    You have done it! I hope this guide helped you. Have a good day!
  • Loading...
  • Loading...