Gradle has a set of standard tasks provided by common plugins, but also allows defining custom tasks. A gradle task is an atomic unit of work that is scheduled before or other after tasks depending on task ordering constraints.
Questions tagged [gradle-task]
154 questions
0
votes
1 answer
How to provide the value of a @Nested property of a gradle task?
The gradle doc describes the @Nested annotation for custom gradle tasks:
https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:task_input_output_annotations
Unfortunately, there is no complete example of this mechanism in terms of how…

Nicolas Rouquette
- 428
- 3
- 16
0
votes
0 answers
Gradle Task on kotlin. Declaration OutputFile value
I want to write very simple task, which downloads a zip and unzip current file.
open class HelmInstall : DefaultTask() {
@Input
var downloadUrl = "https://someZip"
@Input
var destDir: String = ".helm"
@TaskAction
fun…

Tim
- 155
- 1
- 3
- 13
0
votes
1 answer
Why can’t I copy my dependencies before finishing the assemble task?
The assemble task includes the following tasks, as far as I know:
:compileJava
:processResources
:classes
:jar
:assemble
My jar task depends on a copy library task in which I copy all my libraries from my implementation configuration into a libs…

elsamuray7
- 79
- 1
- 10
0
votes
1 answer
Skipping task as it has no source files and no previous output files
This is my build.gradle which has three tasks (one for downloading the zip, one for unzipping it and other for executing the sh file). These tasks are dependent on each other. I am using Gradle 6. As these are dependent tasks I have used following…

PeaceIsPearl
- 329
- 2
- 6
- 19
0
votes
0 answers
Gradle how to invoke task after finish execution phase
Hai everyone currentlly i am confuse on how to invoking an gradle custom task during execution phase, usually invoke by using terminal console "gradle task hello", but now wanna invoke hello task during execution phase each time run the main(string…

Steven Y.
- 41
- 1
- 6
0
votes
1 answer
Custom Gradle Task depends on Plugin
Summary: I want to write a gradle task which depends on a plugin. In particular I want to use the plugin org.hidetake.ssh for my deploy task
I have the following project structure
build.gradle
settings.gradle
some-modules/
|-- src/...
buildSrc/
|--…

Ayk Borstelmann
- 316
- 2
- 8
0
votes
1 answer
Wrap few maven plugins into single one
Is it possible to wrap few maven plugins into single one? Like I want to wrap checkstyle plugin, spotbugs & pmd plugins into single one named static-code-analyse plugin and execute all of them at once.
In the Gradle there is some kind on task…

Oleh Kurpiak
- 1,339
- 14
- 34
0
votes
1 answer
Exception in thread "main" io.micronaut.context.exceptions.DependencyInjectionException: Failed to inject value for parameter of class
I am not able to inject dependencies through Gradle task
My build.gradle
task runDataFeeder(type:JavaExec){
classpath = sourceSets.main.runtimeClasspath
main = "example.migrator.RunMigrator"
}
runDataFeeder class pointed to RunMigrator…

Sandesh Bodake
- 17
- 1
- 7
0
votes
0 answers
How to specify classpath manually in JavaExec task in gradle
I have my java class files under build/deploy folder. To execute this locally, I will open cmd in this path and run command
java -classpath .;lib/* mainClass args
Now, I need to achieve same behaviour thru gradle task. My task supposed to run with…

Deenadhayalan M
- 21
- 3
0
votes
1 answer
Why gradle tasks doesn't run in proper order
I have java project with 2 subprojects. With structure like this
- project_root
|- client
|- src
|- build.gradle
|- server
|- src
|- build.gradle
|- build.gradle
All I need is to create 'deploy' task in root buiild.gradle…

Oleg Nestyuk
- 476
- 2
- 14
0
votes
1 answer
Gradle copy task not copying the files
Can someone tell me why my copy task is not working, i have seen some similar questions here but none of them provided a soultion...
def outputJar = "${buildDir}/intermediates/jar"
// Define some tasks which are used in the build process
task…

tinashe.chipomho
- 387
- 2
- 8
- 17
0
votes
1 answer
Flutter error "Finished with error: Gradle task assembleDebug failed with exit code -1"
I'm using windows 10 64-bit system
I'm running default flutter project code on my real device ( Samsung A30)
and I also enabled USB debugging on my phone.
All android versions are installed in my Android Studio. I also updated Flutter SDK and my…
0
votes
1 answer
Create single WireMockServer object with single port
I am very new to Wire mock and gradle. I am planning to setup by using single WireMockServer object with using 8081 port and its configurable in gradle task.
build.gradle
plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id…

amarbogari
- 21
- 3
0
votes
1 answer
Gradle Jar Creating Task getting stucked
I am new to gradle. When running the gradle build task in intelliJ, my task keep running infinitely and never completed. The task is written as follows:
task webjar(type: Jar) {
from(fileTree("build")) {
into "META-INF/resources"
}…

Manish
- 1,274
- 3
- 22
- 59
0
votes
1 answer
Gradle: how to run a task for specified input files?
I have a Gradle build file which uses ProtoBuffer plugin and runs some tasks. At some point some tasks are run for some files, which are inputs to tasks.
I want to modify the set of files which is the input to those tasks. Say, I want the tasks to…

Very Belly
- 1
- 2