Back Home

Getting Started

For windows

1) download and unzip Gradle

2) Add to path (advanced settings)

For existing projects:

3) Navigate to development project folder, at promp type gradle init

In IntelliJ

5) Edit build.gradle file to contain the basic template

apply plugin: 'java'
repositories {
    // compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.1'

6) Add any relevant libraries in the dependencies section - format can be found here:

Native Exec - command call

task nativeImage(type: JavaExec) {
    classpath = sourceSets.main.runtimeClasspath
    main = project.mainClassName
    executable = 'native-image'
    jvmArgs '-H:+ReportUnsupportedElementsAtRuntime'

FatJar - ShadowJar

// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'application'
mainClassName = 'Main'
buildscript {
    repositories {
    dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
apply plugin: 'com.github.johnrengelman.shadow'
// In this section you declare where to find the dependencies of your project
repositories {
    // Use 'jcenter' for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
    maven {url = "" }
// In this section you declare the dependencies for your production and test code
dependencies {
    compile 'io.vertx:vertx-core:3.3.2'
    compile 'io.vertx:vertx-web:3.3.2'
    compile 'io.vertx:vertx-web-templ-handlebars:3.3.0'
    compile 'org.slf4j:slf4j-api:1.7.21'
    compile 'org.slf4j:slf4j-log4j12:1.7.5'
    compile "org.codehaus.groovy:groovy-all:2.3.11"
    compile(group: 'com.umgi.est.technicalservices', name: 'enterprise-technicalservices-commons', version: '4.0.0')
    compile 'io.searchbox:jest:1.0.1'
    compile 'com.mashape.unirest:unirest-java:1.4.9'
    testCompile 'junit:junit:4.12'
shadowJar {
    manifest {
        attributes 'Implementation-Title': 'Xpath checker',
                'Implementation-Version': '1.0',
                'Main-Class': 'Main'

Note this needs a definition to work as well as the manifest mainClassName = 'Main'

Gradle Plugins

gradle.txt · Last modified: 2019/12/13 06:07 by root
RSS - 200 © CrosswireDigitialMedia Ltd