You can see the list of tasks with the command below.
.\gradlew.bat task --all
It is displayed as below.
> Task :tasks
------------------------------------------------------------
Tasks runnable from root project
------------------------------------------------------------
Application tasks
-----------------
bootRun - Runs this project as a Spring Boot application.
Build tasks
-----------
assemble - Assembles the outputs of this project.
bootJar - Assembles an executable jar archive containing the main classes and their dependencies.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
classes - Assembles main classes.
clean - Deletes the build directory.
jar - Assembles a jar archive containing the main classes.
testClasses - Assembles test classes.
Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.
Documentation tasks
-------------------
javadoc - Generates Javadoc API documentation for the main source code.
Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'demo'.
components - Displays the components produced by root project 'demo'. [incubating]
dependencies - Displays all dependencies declared in root project 'demo'.
dependencyInsight - Displays the insight into a specific dependency in root project 'demo'.
dependencyManagement - Displays the dependency management declared in root project 'demo'.
dependentComponents - Displays the dependent components of components in root project 'demo'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'demo'. [incubating]
outgoingVariants - Displays the outgoing variants of root project 'demo'.
projects - Displays the sub-projects of root project 'demo'.
properties - Displays the properties of root project 'demo'.
tasks - Displays the tasks runnable from root project 'demo'.
Verification tasks
------------------
check - Runs all checks.
test - Runs the unit tests.
Other tasks
-----------
compileJava - Compiles main Java source.
compileTestJava - Compiles test Java source.
prepareKotlinBuildScriptModel
processResources - Processes main resources.
processTestResources - Processes test resources.
Rules
-----
Pattern: clean<TaskName>: Cleans the output files of a task.
Pattern: build<ConfigurationName>: Assembles the artifacts of a configuration.
Pattern: upload<ConfigurationName>: Assembles and uploads the artifacts belonging to a configuration.
There are nine build tasks alone.
There are tasks derived from the java
plugin and tasks derived from the ʻorg.springframework.boot` plugin.
Build tasks
-----------
assemble - Assembles the outputs of this project.
bootJar - Assembles an executable jar archive containing the main classes and their dependencies.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
classes - Assembles main classes.
clean - Deletes the build directory.
jar - Assembles a jar archive containing the main classes.
testClasses - Assembles test classes.
The task dependencies are easy to understand by looking at the image below.
(Reprinted from https://docs.gradle.org/current/userguide/java_plugin.html#sec:java_tasks)
After generating the jar
file, it also generates the product set in ʻarchives. You can also create a custom
zip file at build time by creating a zip-generating task and adding it to ʻarchives
.
Output
> Task :compileJava
> Task :processResources
> Task :classes
> Task :bootJar
> Task :jar SKIPPED
> Task :assemble
The task of generating an executable jar
file that contains the main class and all its dependencies.
If you don't want to run the test and just want the jar
file, do this task.
Output
> Task :compileJava
> Task :processResources
> Task :classes
> Task :bootJar
Perform this task when building normally. For multi-project, build only the current project. The test is also run and a test report is generated under the build \ reports
directory.
Output
> Task :compileJava
> Task :processResources
> Task :classes
> Task :bootJar
> Task :jar SKIPPED
> Task :assemble
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :test
2020-04-30 13:26:22.615 INFO 5520 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
> Task :processTestResources NO-SOURCE
> Task :testClasses
One of the build methods for multi-project. If you build with buildDependents
, all projects that have a dependency of the testRuntimeClasspath
setting in the current project will also be built.
Output
> Task :compileJava
> Task :processResources
> Task :classes
> Task :bootJar
> Task :jar SKIPPED
> Task :assemble
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :test
2020-04-30 13:27:15.725 INFO 16828 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
> Task :check
> Task :build
> Task :buildDependents
One of the build methods for multi-project. Not only the current project, but all projects that the project depends on with the testRuntimeClasspath
setting will be built.
Output
> Task :compileJava
> Task :processResources
> Task :classes
> Task :bootJar
> Task :jar SKIPPED
> Task :assemble
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :test
2020-04-30 13:27:40.483 INFO 9032 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
> Task :check
> Task :build
> Task :buildNeeded
The task of compiling Java main
source code and creating class files.
IntelliJ has a decompiler that can parse the contents of class files on the IDE, but the substance is compiled bytecode.
Output
> Task :compileJava
> Task :processResources
> Task :classes
The task of deleting the build
directory.
Output
> Task :clean
Compile the main
source set and generate a jar
file.
In this project, the jar
task is skipped probably because there is a bootJar
task.
Output
> Task :compileJava
> Task :processResources
> Task :classes
> Task :jar SKIPPED
The task of compiling Java test
source code and creating test class files.
Output
> Task :compileJava
> Task :processResources
> Task :classes
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
Recommended Posts