gradle
8.2

# JavaPlugin

abstract class JavaPlugin : Plugin<T>

A Plugin which compiles and tests Java source, and assembles it into a JAR file.

This plugin creates a built-in test suite named `test` that represents the Test task for Java projects.

#### See also

<a href="https://docs.gradle.org/current/userguide/java_plugin.html">Java plugin reference</a>
<a href="https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html">JVM test suite plugin reference</a>

## Constructors

JavaPlugin
Link copied to clipboard
@Inject
constructor(objectFactory: ObjectFactory)

## Functions

apply
Link copied to clipboard
open fun apply(project: Project)

## Properties

ANNOTATION_PROCESSOR_CONFIGURATION_NAME
Link copied to clipboard
val ANNOTATION_PROCESSOR_CONFIGURATION_NAME: String = "annotationProcessor"
The name of the annotation processor configuration.
API_CONFIGURATION_NAME
Link copied to clipboard
val API_CONFIGURATION_NAME: String = "api"
The name of the API configuration, where dependencies exported by a component at compile time should be declared.
API_ELEMENTS_CONFIGURATION_NAME
Link copied to clipboard
val API_ELEMENTS_CONFIGURATION_NAME: String = "apiElements"
The name of the configuration to define the API elements of a component.
CLASSES_TASK_NAME
Link copied to clipboard
val CLASSES_TASK_NAME: String = "classes"
The name of the lifecycle task which outcome is that all the classes of a component are generated.
COMPILE_CLASSPATH_CONFIGURATION_NAME
Link copied to clipboard
val COMPILE_CLASSPATH_CONFIGURATION_NAME: String = "compileClasspath"
The name of the compile classpath configuration.
COMPILE_JAVA_TASK_NAME
Link copied to clipboard
val COMPILE_JAVA_TASK_NAME: String = "compileJava"
The name of the task which compiles Java sources.
COMPILE_ONLY_API_CONFIGURATION_NAME
Link copied to clipboard
val COMPILE_ONLY_API_CONFIGURATION_NAME: String = "compileOnlyApi"
The name of the configuration to define the API elements of a component that are required to compile a component, but not at runtime.
COMPILE_ONLY_CONFIGURATION_NAME
Link copied to clipboard
val COMPILE_ONLY_CONFIGURATION_NAME: String = "compileOnly"
The name of the configuration that is used to declare dependencies which are only required to compile a component, but not at runtime.
COMPILE_TEST_JAVA_TASK_NAME
Link copied to clipboard
val COMPILE_TEST_JAVA_TASK_NAME: String = "compileTestJava"
The name of the task which compiles the test Java sources.
IMPLEMENTATION_CONFIGURATION_NAME
Link copied to clipboard
val IMPLEMENTATION_CONFIGURATION_NAME: String = "implementation"
The name of the implementation configuration, where dependencies that are only used internally by a component should be declared.
JAR_TASK_NAME
Link copied to clipboard
val JAR_TASK_NAME: String = "jar"
The name of the task which generates the component main jar.
JAVADOC_ELEMENTS_CONFIGURATION_NAME
Link copied to clipboard
val JAVADOC_ELEMENTS_CONFIGURATION_NAME: String = "javadocElements"
The name of the javadoc elements configuration.
JAVADOC_TASK_NAME
Link copied to clipboard
val JAVADOC_TASK_NAME: String = "javadoc"
The name of the task which generates the component javadoc.
PROCESS_RESOURCES_TASK_NAME
Link copied to clipboard
val PROCESS_RESOURCES_TASK_NAME: String = "processResources"
The name of the task that processes resources.
PROCESS_TEST_RESOURCES_TASK_NAME
Link copied to clipboard
val PROCESS_TEST_RESOURCES_TASK_NAME: String = "processTestResources"
The name of the task which processes the test resources.
RUNTIME_CLASSPATH_CONFIGURATION_NAME
Link copied to clipboard
val RUNTIME_CLASSPATH_CONFIGURATION_NAME: String = "runtimeClasspath"
The name of the runtime classpath configuration, used by a component to query its own runtime classpath.
RUNTIME_ELEMENTS_CONFIGURATION_NAME
Link copied to clipboard
val RUNTIME_ELEMENTS_CONFIGURATION_NAME: String = "runtimeElements"
The name of the runtime elements configuration, that should be used by consumers to query the runtime dependencies of a component.
RUNTIME_ONLY_CONFIGURATION_NAME
Link copied to clipboard
val RUNTIME_ONLY_CONFIGURATION_NAME: String = "runtimeOnly"
The name of the runtime only dependencies configuration, used to declare dependencies that should only be found at runtime.
SOURCES_ELEMENTS_CONFIGURATION_NAME
Link copied to clipboard
val SOURCES_ELEMENTS_CONFIGURATION_NAME: String = "sourcesElements"
The name of the sources elements configuration.
TEST_ANNOTATION_PROCESSOR_CONFIGURATION_NAME
Link copied to clipboard
val TEST_ANNOTATION_PROCESSOR_CONFIGURATION_NAME: String = "testAnnotationProcessor"
The name of the test annotation processor configuration.
TEST_CLASSES_TASK_NAME
Link copied to clipboard
val TEST_CLASSES_TASK_NAME: String = "testClasses"
The name of the lifecycle task which outcome is that all test classes of a component are generated.
TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME
Link copied to clipboard
val TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME: String = "testCompileClasspath"
The name of the test compile classpath configuration.
TEST_COMPILE_ONLY_CONFIGURATION_NAME
Link copied to clipboard
val TEST_COMPILE_ONLY_CONFIGURATION_NAME: String = "testCompileOnly"
The name of the configuration that should be used to declare dependencies which are only required to compile the tests, but not when running them.
TEST_IMPLEMENTATION_CONFIGURATION_NAME
Link copied to clipboard
val TEST_IMPLEMENTATION_CONFIGURATION_NAME: String = "testImplementation"
The name of the test implementation dependencies configuration.
TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME
Link copied to clipboard
val TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME: String = "testRuntimeClasspath"
The name of the test runtime classpath configuration.
TEST_RUNTIME_ONLY_CONFIGURATION_NAME
Link copied to clipboard
val TEST_RUNTIME_ONLY_CONFIGURATION_NAME: String = "testRuntimeOnly"
The name of the test runtime only dependencies configuration.
TEST_TASK_NAME
Link copied to clipboard
val TEST_TASK_NAME: String = "test"
The name of the task which triggers execution of tests.