minimal bugtracker as java ee7 reference project using wildfly 8, gradle, arquillian and spock
Java HTML CSS Groovy
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Minimal bugtracker as java ee7 reference project using wildfly 9, gradle, arquillian and spock , and on the JEE side jsf, restful webservices, ejb, jpa and cdi

It is meant to be used in conjunction with the project wildfly-git-install:

which features a wildfly installation from a git repository and externalized local configuration.


The gradle build script generates automatically a unique buildId and puts into the META-INF directory of the generated .war file so it can be read and displayed by the application. The buildId contains the git commit the build is based on, a timestamp an the username:

jtrack gd67182f B20140622 1851 mw

If git considers the workspace dirty, a * is added:

jtrack gd67182f*  B20140622 1851 mw

Git tags are automatically associated:

jtrack V_1_6 gd67182f B20140622 1851 mw

The application displays the buildId in the footer of its web pages, so you can always easily identify the binary your dealing with


The deployment-task relies on the environment variable $JBOSS_HOME which should point to the WildFly installation.

The deploy task shows how to deploy by drop-in and check the outcome by evaluating the marker files generated by wildfly and waits until deployment was either successful or failed.


For the loadDB task to function properly, you need to have a file $HOME/ which contains the database access parameters like this:

exampleds.jdbc.url: jdbc:postgresql:example
exampleds.user: wildfly
exampleds.password: wildfly


The tests show just how easy and elegant the source code is using spock and groovy. The following example shows head to read the userlist restful:

def "read userlist restful"() {
		def jtrack = new RESTClient( 'http://localhost:8080/jtrack-ee7/items/')
		def response=jtrack.get(path: 'user')
		assert response.status == 200
		assert response.contentType == JSON.toString()
		assert ( instanceof List )


Java and Gradle

First, we need to install Java JDK 1.8 and Gradle 2.5 or higher which can be found at The whole example works without IDE using only the commandline although project files for the Spring Tool Suite are included. I found it always very important to be able to build and test the complete project on the commandline so it can easily be built on every server or workstation of the continuous integration pipeline.
To install Gradle, just unzip the archive and set the environment variables accordingly. Suppose we have both Java and Gradle installed in /home/opt, our environment variables in .bash_profile or .bashrc should look like this (assuming a Mac or Linux system, Windows users please adjust the syntax accordingly):

export JAVA_HOME=/home/opt/jdk8
export GRADLE_HOME=/home/opt/gradle
export JBOSS_HOME=$HOME/wildfly-git-install

Database PostgreSQL

We need to install and configure PostgreSQL: basically, all we need is a valid login into a database via TCP. Mastertheboss has of course the adequate tutorial: The first section is sufficient.Then make sure the are in your $HOME directory and its contents adjusted to your system.

Get it running

Start wildfly:

./bin/ --server-config=standalone-full.xml -P=$HOME/

Then build the application, deploy it and load some testdata:

cd jtrack-ee7
gradle loadDB

To run the tests:

cd jtrack-ee7
gradle clean loadDB test


It is no problem to build the project with the Jenkins Continuous Integration Server. Just install the following plugins: git, git-client and gradle. Then configure a new job and add there the git repository and one gradle build step with these targets

clean loadDB test

Spock Arquillian

To use the elegant Spock test specifications for in-container tests with Arquillian, please checkout the branch spock_arquillian of jtrack. An example test is included.