Gradle JavaExec Task Type: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 38: Line 38:
args = 'A B C'
args = 'A B C'
</syntaxhighlight>
</syntaxhighlight>
The string will be broken into space-separated tokens and provided as individual command line arguments.


==<tt>environment</tt>==
==<tt>environment</tt>==


==<tt>systemProperties</tt>==
==<tt>systemProperties</tt>==

Revision as of 19:45, 3 February 2021

External

Internal

Overview

Executes a Java application as a child process. To get details on the actual java command line, execute Gradle with -i command line option.

task someTask(type: JavaExec) {
    classpath = configurations.runtimeClasspath
    main = 'myPackage.MyMainClass'
    args 'something somethingelse'
    jvmArgs = ['-Xmx12g']
    environment "LD_LIBRARY_PATH", "/usr/local/lib"
    systemProperties [ "some.prop": "some.value", "some.other.prop": "some.other.value" ]
}

Configuration

classpath

classpath = sourceSets.main.runtimeClasspath
classpath = configurations.runtimeClasspath

main

The main class. Must be available on classpath.

main = 'playground.javaExec.Main'

args

args = 'A B C'

The string will be broken into space-separated tokens and provided as individual command line arguments.

environment

systemProperties