interface JavaExecSpec : JavaForkOptions, BaseExecSpec
Specifies the options for executing a Java application.
abstract fun args(vararg args: Any): JavaExecSpec abstract fun args(args: MutableIterable<*>): JavaExecSpec
Adds args for the main class to be executed. |
|
abstract fun classpath(vararg paths: Any): JavaExecSpec
Adds elements to the classpath for executing the main class. |
|
abstract fun getArgs(): MutableList<String>
Returns the arguments passed to the main class to be executed. |
|
abstract fun getArgumentProviders(): MutableList<CommandLineArgumentProvider>
Argument providers for the application. |
|
abstract fun getClasspath(): FileCollection
Returns the classpath for executing the main class. |
|
abstract fun getMain(): String
Returns the fully qualified name of the Main class to be executed. |
|
abstract fun setArgs(args: MutableList<String>): JavaExecSpec abstract fun setArgs(args: MutableIterable<*>): JavaExecSpec
Sets the args for the main class to be executed. |
|
abstract fun setClasspath(classpath: FileCollection): JavaExecSpec
Sets the classpath for executing the main class. |
|
abstract fun setMain(main: String): JavaExecSpec
Sets the fully qualified name of the main class to be executed. |
abstract fun bootstrapClasspath(vararg classpath: Any): JavaForkOptions
Adds the given values to the end of the bootstrap classpath for the process. |
|
abstract fun copyTo(options: JavaForkOptions): JavaForkOptions
Copies these options to the given options. |
|
abstract fun getAllJvmArgs(): MutableList<String>
Returns the full set of arguments to use to launch the JVM for the process. This includes arguments to define system properties, the minimum/maximum heap size, and the bootstrap classpath. |
|
abstract fun getBootstrapClasspath(): FileCollection
Returns the bootstrap classpath to use for the process. The default bootstrap classpath for the JVM is used when this classpath is empty. |
|
abstract fun getCommandLine(): MutableList<String>
Returns the full command line, including the executable plus its arguments. |
|
abstract fun getDebug(): Boolean
Determines whether debugging is enabled for the test process. When enabled — |
|
abstract fun getDefaultCharacterEncoding(): String
Returns the default character encoding to use. |
|
abstract fun getEnableAssertions(): Boolean
Returns true if assertions are enabled for the process. |
|
abstract fun getErrorOutput(): OutputStream
Returns the output stream to consume standard error from the process executing the command. Default to |
|
abstract fun getJvmArgs(): MutableList<String>
Returns the extra arguments to use to launch the JVM for the process. Does not include system properties and the minimum/maximum heap size. |
|
abstract fun getJvmArgumentProviders(): MutableList<CommandLineArgumentProvider>
Command line argument providers for the java process to fork. |
|
abstract fun getMaxHeapSize(): String
Returns the maximum heap size for the process, if any. |
|
abstract fun getMinHeapSize(): String
Returns the minimum heap size for the process, if any. |
|
abstract fun getStandardInput(): InputStream
Returns the standard input stream for the process executing the command. The stream is closed after the process completes. Defaults to an empty stream. |
|
abstract fun getStandardOutput(): OutputStream
Returns the output stream to consume standard output from the process executing the command. Defaults to |
|
abstract fun getSystemProperties(): MutableMap<String, Any>
Returns the system properties which will be used for the process. |
|
abstract fun isIgnoreExitValue(): Boolean
Tells whether a non-zero exit value is ignored, or an exception thrown. Defaults to |
|
abstract fun jvmArgs(arguments: MutableIterable<*>): JavaForkOptions abstract fun jvmArgs(vararg arguments: Any): JavaForkOptions
Adds some arguments to use to launch the JVM for the process. |
|
abstract fun setAllJvmArgs(arguments: MutableList<String>): Unit abstract fun setAllJvmArgs(arguments: MutableIterable<*>): Unit
Sets the full set of arguments to use to launch the JVM for the process. Overwrites any previously set system properties, minimum/maximum heap size, assertions, and bootstrap classpath. |
|
abstract fun setBootstrapClasspath(classpath: FileCollection): Unit
Sets the bootstrap classpath to use for the process. Set to an empty classpath to use the default bootstrap classpath for the specified JVM. |
|
abstract fun setDebug(enabled: Boolean): Unit
Enable or disable debugging for the process. When enabled, the process is started suspended and listening on port 5005. |
|
abstract fun setDefaultCharacterEncoding(defaultCharacterEncoding: String): Unit
Sets the default character encoding to use. Note: Many JVM implementations support the setting of this attribute via system property on startup (namely, the |
|
abstract fun setEnableAssertions(enabled: Boolean): Unit
Enable or disable assertions for the process. |
|
abstract fun setErrorOutput(outputStream: OutputStream): BaseExecSpec
Sets the output stream to consume standard error from the process executing the command. The stream is closed after the process completes. |
|
abstract fun setIgnoreExitValue(ignoreExitValue: Boolean): BaseExecSpec
Sets whether a non-zero exit value is ignored, or an exception thrown. |
|
abstract fun setJvmArgs(arguments: MutableList<String>): Unit abstract fun setJvmArgs(arguments: MutableIterable<*>): Unit
Sets the extra arguments to use to launch the JVM for the process. System properties and minimum/maximum heap size are updated. |
|
abstract fun setMaxHeapSize(heapSize: String): Unit
Sets the maximum heap size for the process. |
|
abstract fun setMinHeapSize(heapSize: String): Unit
Sets the minimum heap size for the process. |
|
abstract fun setStandardInput(inputStream: InputStream): BaseExecSpec
Sets the standard input stream for the process executing the command. The stream is closed after the process completes. |
|
abstract fun setStandardOutput(outputStream: OutputStream): BaseExecSpec
Sets the output stream to consume standard output from the process executing the command. The stream is closed after the process completes. |
|
abstract fun setSystemProperties(properties: MutableMap<String, *>): Unit
Sets the system properties to use for the process. |
|
abstract fun systemProperties(properties: MutableMap<String, *>): JavaForkOptions
Adds some system properties to use for the process. |
|
abstract fun systemProperty(name: String, value: Any): JavaForkOptions
Adds a system property to use for the process. |
open class JavaExec : ConventionTask, JavaExecSpec
Executes a Java application in a child process. Similar to org.gradle.api.tasks.Exec, but starts a JVM with the given classpath and application class.
The process can be started in debug mode (see
|