public interface JavaApplication
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") }
Modifier and Type | Method | Description |
---|---|---|
java.lang.Iterable<java.lang.String> |
getApplicationDefaultJvmArgs() |
Array of string arguments to pass to the JVM when running the application
|
CopySpec |
getApplicationDistribution() |
The specification of the contents of the distribution.
|
java.lang.String |
getApplicationName() |
The name of the application.
|
java.lang.String |
getExecutableDir() |
Directory to place executables in
|
Property<java.lang.String> |
getMainClass() |
The fully qualified name of the application's main class.
|
java.lang.String |
getMainClassName() |
Deprecated.
Use
getMainClass() instead. |
Property<java.lang.String> |
getMainModule() |
The name of the application's Java module if it should run as a module.
|
void |
setApplicationDefaultJvmArgs(java.lang.Iterable<java.lang.String> applicationDefaultJvmArgs) |
Array of string arguments to pass to the JVM when running the application
|
void |
setApplicationDistribution(CopySpec applicationDistribution) |
|
void |
setApplicationName(java.lang.String applicationName) |
The name of the application.
|
void |
setExecutableDir(java.lang.String executableDir) |
Directory to place executables in
|
void |
setMainClassName(java.lang.String mainClassName) |
Deprecated.
Set via
getMainClass() instead. |
java.lang.String getApplicationName()
void setApplicationName(java.lang.String applicationName)
Property<java.lang.String> getMainModule()
Property<java.lang.String> getMainClass()
@Deprecated @ReplacedBy("mainClass") java.lang.String getMainClassName()
getMainClass()
instead.@Deprecated void setMainClassName(java.lang.String mainClassName)
getMainClass()
instead.java.lang.Iterable<java.lang.String> getApplicationDefaultJvmArgs()
void setApplicationDefaultJvmArgs(java.lang.Iterable<java.lang.String> applicationDefaultJvmArgs)
java.lang.String getExecutableDir()
void setExecutableDir(java.lang.String executableDir)
CopySpec getApplicationDistribution()
The specification of the contents of the distribution.
Use this CopySpec
to include extra files/resource in the application distribution.
plugins { id '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.
void setApplicationDistribution(CopySpec applicationDistribution)