Using the Jenkins CI with Sponge/Bukkit Plugins (and Maven?)

So I’ve recently realized that it is insanely easy to setup a Jenkins CI server (on Windows OS at least, may try in a Linux VM later). However, I’m not really sure where to go from there. I don’t develop much outside Bukkit plugins, so I’ve always been inclined to including dependencies and compiling via the IDE.

I use IntelliJ, and I don’t really use any external tools to assist with development other than that. I’ve installed Gradle and it works fine, but don’t really know how to use that either or if it works with Jenkins at all. Just know that the test runs worked. I would like to figure out Maven as well and have it integrated into either IntelliJ, Jenkins, or both, but of course, don’t know how to use it or integrate it. If what I assume of Maven is correct, then I’m guessing it’s responsible for auto-fetching dependencies that you list in POM.xml or something like that, to make life easier and prevent outdated dependencies. I just managed to get Maven installed and the --version flag returns a valid output, but still not sure how to use it.

Lastly, I’m pretty much entirely new to Jenkins. I’ve used it for a while to download quite a few plugins and updates, but never set it up before. I’ve gotten as far as running it as a service and being able to access it via localhost:8080 and now I have it so that it’s using security and my account has access to everything.

So, in summary, I’d appreciate it if anyone was inclined to setup a noob-friendly guide to configuring a Jenkins project, IntelliJ, and Maven in such a way that would be ideal for developing Bukkit plugins (and I’m assuming that Spigot development will be fairly similar in setup after that). Any pictures you’re inclined to include to clarify certain steps is welcome! Don’t even mind if you post as a new thread and just link that for me, others might find it helpful on how to setup a proper development environment. Mostly interested in knowing after reading @TheYeti’s post here (simply stating a few good ideas on how to start a new project). Thanks in advance!

It is very important that you understand your components first.

You will need:

  • a Version Control System (VCS), I would suggest git or subversion (you can get a repo at github or bitbucket)
  • a build automation system, I would suggest Maven or Gradle
  • a continuous integration system i.e. Jenkins
  • probably an IDE so you don’t have to code like a cave man i.e. IntelliJ

For the setup I would start out with a simple git repo for your plugin with maven. You can look at my simple BedNerf plugin for a Bukkit Maven example.
You can then setup a plain Jenkins server and create a new project, there’s even a github plugin for Jenkins which you can configure to checkout your code on every push to the repo and build the project (Webhooks).

It is not complicated per se, but it’s quite a lot of tools that have to work together.

Gotcha. I have a GitHub with most of my projects on it, but it’s likely not using the structure that a Maven project would use. I mostly used GitHub since my PC will shut down every 2-4 hours (running on the generator) and I needed an external way to automatically sync code to so I didn’t keep losing and corrupting my code. They only tend to have the src folder rather than the java/src, etc. Not even really sure how an idea Mavel folder structure would be. Guess I could see if IntelliJ can setup a blank Maven project and see how that goes. I’ve managed to install both Maven and Gradle, but it doesn’t look like Jenkins uses Gradle. Just got Jenkins mostly setup again, although it’s being a bit strange running as a service. And definitely have the IDE. When I sort out why Jenkins isn’t letting me access it properly despite working fine running via console, then I’ll look into the GitHub plugin, that sounds like it’d help a bit, so assumedly it’d re-build automatically when I sync local commits…

So it seems my Jenkins doesn’t retain user information? I’m not sure why, but if I install it, set it so that the name I’m going to register has all perms, enable security, then register the name, it works. But if at any point I restart Jenkins, it forgets my permissions and says I don’t have Overall/Read access. Is there a way around this? I set it up to use matrix-based permissions and use Jenkin’s own user database.

I think its a better idea to create a KitchenSink. Personally i don’t really like Jenkins CI, don’t know why.

Can’t say I’ve ever heard of that. Have a link to it? Or maybe some documentation or a demo?

It’s like BukkitDev. Thats called a KitchenSink

O.o Is that an alternative to Jenkins? Never thought of BukkitDev as a CI, but I guess it would’ve been for the CraftBukkit and Bukkit downloads.

Here’s a link to a thread that mentions it. BukkitDev for Sponge!?

Couldn’t really find anything by that name mentioned on that thread O.o Afraid ya’ve just confused me at this point XD

I am sorry for confusing you. :stuck_out_tongue: Why not Google it? Google’s it Hmm beautiful pictures of sinks… :question:

I tried, but ended up with some sorta Appcelerator company for mobile development and renovation companies of some sort, so not sure if it was a misspelling or what XD

Found where it was mentioned (Here):

The only thing I can find on it is a GitHub repo, but it doesn’t really seem to fit what I want to do. Like this site says:

Kitchen Sink for Mobile is a developer companion application, showcasing the use of nearly every API and option available in the Titanium Mobile SDK.

Just doesn’t sound quite like what I’d want to run. I’ve seen Jenkins and it works alright for those who can get it set up correctly, I just seem to be having some permission issues I want to sort out.