Class JdkProviderPlugin
- All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>
The plugin registers an extension named "jdk" of type JdkExtension.
This extension allows users to specify JDK requirements such as version, vendor, operating system,
architecture, and additional capabilities (e.g., native image support or bundled JavaFX).
Upon evaluation of the project: 1. The plugin resolves the requested JDK based on the specification provided through the extension. 2. If automatic download is enabled and the Gradle offline mode is not active, the plugin attempts to download the matching JDK if not found in standard installation paths or in the local cache. 3. The identified JDK is copied or linked into the project's build directory. 4. The plugin updates relevant build tasks (e.g., JavaExec, JavaCompile, Test, Javadoc) to use the resolved JDK executables.
If no matching JDK is found, or if an error occurs during resolution or installation, the
plugin throws a GradleException with details about the failure.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(org.gradle.api.Project project) Apply the plugin to the project as described in the plugin class description.
-
Constructor Details
-
JdkProviderPlugin
public JdkProviderPlugin()Default constructor.
-
-
Method Details
-
apply
public void apply(org.gradle.api.Project project) Apply the plugin to the project as described in the plugin class description.- Specified by:
applyin interfaceorg.gradle.api.Plugin<org.gradle.api.Project>- Parameters:
project- the project to apply the plugin to
-