Table of Contents
| API Documentation: | JavaApplication |
|---|
Configuration for a Java application, defining how to assemble the application.
An instance of this type is added as a project extension by the Java application plugin under the name 'application'.
plugins {
id 'application'
}
application {
mainClass.set("com.foo.bar.FooBar")
}
| Property | Description |
applicationDefaultJvmArgs | Array of string arguments to pass to the JVM when running the application |
applicationDistribution | The specification of the contents of the distribution. |
applicationName | The name of the application. |
executableDir | Directory to place executables in |
mainClass | The fully qualified name of the application's main class. |
mainModule | The name of the application's Java module if it should run as a module. |
Array of string arguments to pass to the JVM when running the application
- Default value:
[]
CopySpec applicationDistribution
The specification of the contents of the distribution.
Use this CopySpec to include extra files/resource in the application distribution.
plugins {
id 'application'
}
application {
applicationDistribution.from("some/dir") {
include "*.txt"
}
}
Note that the application plugin pre configures this spec to; include the contents of "src/dist",
copy the application start scripts into the "bin" directory, and copy the built jar and its dependencies
into the "lib" directory.
- Default value:
- A copy spec that includes all of the contents of
src/dist, copies the start scripts intobin, and copies the built jar and all dependencies intolib
The fully qualified name of the application's main class.
- Default value:
null