On this page you learn how to compile MassiveCore and Factions.
Create your MassiveCraft directory
Step one is to create your MassiveCraft code project directory. It can be a new directory on your desktop for example. The location of this directory does not matter. Place it anywhere you like. Call the directory “MassiveCraft”.
Check out from GitHub
Step two is to check out a few projects from GitHub. You should check them out into your MassiveCraft directory.
On a unix OS the commands could look like this:
git clone firstname.lastname@example.org:MassiveCraft/Factions.git
git clone email@example.com:MassiveCraft/MassiveCore.git
git clone firstname.lastname@example.org:MassiveCraft/MassiveCoreXlib.git
git clone email@example.com:MassiveCraft/MassiveCoreXlibGuava.git
git clone firstname.lastname@example.org:MassiveCraft/MassiveSuper.git
You don’t have to use the command line if you don’t want to. Feel free to use any Git client of your choice.
Create the MassiveCraft meta POM
Step three is to manually create a file called pom.xml with the following content:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- Basics -->
<!-- Modules -->
<!-- Build -->
Use a text editor of your choice. Could be Notepad++, SublimeText, or Atom or any text editor you like. What is important is that the file has that content, is called “pom.xml” and placed within your MassiveCraft directory.
Build using Maven Command Line
Step four is to build this project using the “mvn” command in your terminal. While standing in your MassiveCraft directory type “mvn clean install”. It will then build all of the four repositories you checked out in the proper order.
Creating an IntelliJ project
Start the IntelliJ application. In the screenshots I use IntelliJ Ultimate but the Community edition works just fine. Click “Import Project” select your “MassiveCraft/pom.xml” file. The dialog below will open.
Check the checkbox “Import Maven projects automatically”. The other options are fine as is. Click next a few times till the project is fully imported.
Since IntelliJ does not understand the Maven Shade plugin too well we must ignore two projects. Ignore both MassiveCoreXlib and MassiveCoreXlibGuava.
That’s about that. As can be seen above you may now hack away!
Other Noteworthy Stuff
The version numbers must match
The version numbers in all of the 5 sub projects must match. The version number in MassiveCraft/pom.xml can be 1.0.0 forever. That is just a dummy version number. For the version numbers in the sub projects however, they must be in sync. So it is important to remember to pull all Git repositories at the same time. I always push in such a way that they are the same in the repositories. If you want older versions I recently started tagging the special version commits. You can for example do “git checkout v2.13.6” as can be seen here: https://github.com/MassiveCraft/Factions/releases.
Code in IntelliJ but compile in the command line
Sadly IntelliJ does not understand the Maven shade plugin especially well. The nature of MassiveCoreXlib and MassiveCoreXlibGuava is really quite shady. With that in mind compiling from the terminal using “mvn clean install” but coding in IntelliJ is the way I personally do it.
Is there an official MassiveCraft Maven repository?
Sadly no. Not at this point. This is something we would like to look into so that you would not have to compile everything yourself. Currently however there is no Maven repo and you really have to check all of these repos out, make a meta pom, and compile as described in this tutorial.