Dissecting a build.gradle file

As a reference, the following parts form a build.gradle file for a simple Java project:

group 'org.asysob'
version '1.0'

The organisational identifier for the project and the current version.

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M3'
        classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.0'
    }
}

Continue reading “Dissecting a build.gradle file”

Java example using GSON, 0MQ and built with Gradle

Just implemented a little Java program where a publisher sends JSON encoded messages that are received by a subscriber. The messages contain simple integers and are tagged as even or odd. PUB/SUB is done with the pure Java 0MQ implementation jeromq while the GSON library makes JSON encoding easy. Gradle is my favourite build tool, so this version of the file may serve as a starting point for future projects. JUnit5 and the shadow plugin for Uberjars are already configured; although the first is not used in this project.