Skip to content

Project Setup

Risto Lahtela edited this page Nov 17, 2018 · 35 revisions

Plan Header

Project Set-Up

Page version: 4.5.2

  1. Fork the Plan repository & Clone that repository to your workstation.
    Here is a Tutorial.

  2. Open /Plan/ project folder inside the repository you just downloaded in your favorite IDE.
    Most IDEs will sync the workspace and you can start working on the project.

If you're having issues join Discord or open an issue and I'll help you out.

Building

The project is split into 6 modules.

Module Description
common System related abstractions and main logic is in this package. Most work is done here.
bukkit Bukkit/Spigot/Paper related classes
bungee BungeeCord related classes
sponge Sponge related classes
velocity Velocity related classes
plugin Module for shading all other modules into a single jar

Plan uses Dagger for dependency injection.

Your IDE may be complaining about DaggerPlanBukkitComponent or another Dagger###Component class not being available.
These classes are generated by Dagger and can be fixed by running mvn compile on the project root.

If a constructor with an @Inject is changed, the generated sources may go out of sync.
In this case you will have to run

mvn clean

If you would like to skip tests and build, use

mvn install -DskipTests

Testing

Tests are performed on Travis, but if you would like to run the tests on your machine, do:

mvn test

Running tests inside IntelliJ IDEA

Running tests in IntelliJ IDEA requires some extra set-up because of multiple projects being present.

Testing configuration: Testing configuration

Possible errors:

IntelliJ build window displays hundreds of compile errors and the project compilation fails, with no errors in the editor
This can be fixed by running mvn package and then running the test configuration again.

PlanPluginBridge Project Setup

IMPORTANT

This is not required to work on Plan, and is only required if you want to change things inside PlanPluginBridge

Since PlanPluginBridge uses a collection of other plugins, some of them can not be found in any maven repositories.

Clone this wiki locally