Interface JavaPluginExtension
Common configuration for Java based projects. This is added by the
JavaBasePlugin.- Since:
- 4.10
-
Method Summary
Modifier and TypeMethodDescriptionvoidIf this method is called, Gradle will not automatically try to fetch dependencies which have a JVM version compatible with the target compatibility of this module.Returns the source compatibility used for compiling Java sources.Returns the target compatibility used for compiling Java sources.voidregisterFeature(String name, Action<? super FeatureSpec> configureAction) Registers a feature.voidSets the source compatibility used for compiling Java sources.voidSets the target compatibility used for compiling Java sources.
-
Method Details
-
getSourceCompatibility
JavaVersion getSourceCompatibility()Returns the source compatibility used for compiling Java sources. -
setSourceCompatibility
Sets the source compatibility used for compiling Java sources.- Parameters:
value- The value for the source compatibility
-
getTargetCompatibility
JavaVersion getTargetCompatibility()Returns the target compatibility used for compiling Java sources. -
setTargetCompatibility
Sets the target compatibility used for compiling Java sources.- Parameters:
value- The value for the target compatibility
-
registerFeature
Registers a feature.- Parameters:
name- the name of the featureconfigureAction- the configuration for the feature- Since:
- 5.3
-
disableAutoTargetJvm
If this method is called, Gradle will not automatically try to fetch dependencies which have a JVM version compatible with the target compatibility of this module. This should be used whenever the default behavior is not applicable, in particular when for some reason it's not possible to split a module and that this module only has some classes which require dependencies on higher versions.- Since:
- 5.3
-