Handy utility for dealing with different aspects of Bukkit/Spigot/etc. server version strings.
Add the BukkitVersion package as a dependency to your plugin (or any other project). Example for Maven, using the author's personal repo:
<dependencies>
<dependency>
<groupId>net.ssterling</groupId>
<artifactId>bukkitversion</artifactid>
<version>0.3.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>ssterling-repo</id>
<url>https://www.ssterling.net/comp/maven</url>
</repository>
</repositories>
For a thorough explanation of how to use the library itself in your code, refer to the Javadocs.
Tab characters for indentation; spaces for alignment. Just look through the code and assimilate it.