Plugin Developers - liachmodded/Updatifier GitHub Wiki

##Plugin Developers

It is extremely simple to add Updatifier support into your plugin. There are two ways that you can add support for Updatifier:

  1. Annotate your main plugin class (Recommended)
  2. Use the Updatifer API (Documentation coming soon)

###Adding support for Updatifier - Annotations

There are two simple steps to follow:

  1. Add Updatifier as a Maven or Gradle dependency.
  2. Annotate your main plugin class and add Updatifier as an after dependency.

####Adding Updatifier as a Maven/Gradle Dependency

Updatifier uses JitPack to allow you to add Updatifier as a Maven/Gradle dependency. To get started you need to add JitPack as a repository in your pom.xml:

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

Next you will want to add Updatifer as a dependency:

<dependency>
    <groupId>com.github.Flibio</groupId>
    <artifactId>Updatifier</artifactId>
    <version>RELEASE</version>
</dependency>

The steps are the essentially the same for Gradle, with just a few formatting changes.

####Annotating Your Main Plugin Class

In order for Updatifier to check for updates to your plugin, it needs to know some information about your plugin. To do that, you must annotate your main plugin class with @Updatifier, similar to how you annotate for Sponge with @Plugin. The version tag for the @Updatifier annotation must be the exact same tag format that is found on GitHub. (If I tag version v1.1.2 on GitHub, I must type v1.1.2 in the version tag of the annotation) You also must add Updatifier as an after dependency. An example can be seen below.

@Updatifier(repoName = "EconomyLite", repoOwner = "Flibio", version = "v1.1.0")
@Plugin(id = "EconomyLite", name = "EconomyLite", version = "1.1.0", dependencies = "after: Updatifier")
public class MyClass {

}

Updatifier is not required, meaning if you add support for Updatifier, and a server owner does not have Updatifier installed, no errors will be thrown to the console. The Updatifier annotation will simply be ignored.

###Adding support for Updatifier - Updatifier API

Coming soon...

⚠️ **GitHub.com Fallback** ⚠️