Saturday, February 7, 2015

Gradle Plugin for JBOSS and Wildfly: the flyboss Plugin

So in previous efforts I had worked on a gradle plugin that does some simple stuff with wildfly.   Go see post shere and here to review that.    As mentioned, I felt this plugin could work equally well against JBOSS 7x and JBOSS eap 6x.

While I continued with some light work on this and stuff IRL was pushing me more towards JBOSS EAP 6x; I felt that I should refactor things a bit to make sure it would truly work on jboss and wildfly.   More or less I copy/forked it and created a 'gradle-flyboss-plugin'.

The code for this plugin & post is github at https://github.com/fwelland/gradle-flyboss-plugin.

The Changes

The plugin really didn't change much in function; it still just does start and stops and deploys for archives to a local app server.     However the code has been tweaked to support working with either jboss or wildfly and I made a few internal simplifications and changes as well as laid some foundations for future work.

A Sample

The follow build file is from a multi-part gradle project.  This build file is a standalone or add on build that provides some simple start/stop tasks as well as a deploy (and undeploy) of an artifact in another sub-project.

apply plugin: 'flyboss'
buildscript {
    repositories {
        maven {
            url 'http://dl.bintray.com/fwelland/FredsStuff'
        }
    }   
    dependencies {
        classpath 'org.fhw:gradle-flyboss-plugin:0.1'
    }
}
flyboss {
   appserver_home = '/opt/jboss'
   path_to_deployable =  tasks.getByPath(':main:ear:ear').archivePath
}
deploy.dependsOn  ':main:ear:ear'
task build (dependsOn: deploy )

Some Notes

Like my previous wildfly effort, I am using travis-ci for continuous integration builds.    Also like before I am publishing a plugin jar to BinTray; the latest version will be here:  http://dl.bintray.com/fwelland/FredsStuff.


1 comment: