Questions tagged [gradle-groovy-dsl]
9 questions
50
votes
5 answers
How can I specify a category for a Gradle task?
I am writing a Gradle task in Intellij IDEA. I have noticed that in the Gradle window, the tasks appear under folders like so:
I am wondering, how can you give a task a 'category' so that it appears in a folder as shown in the screenshot?
All the…

Mendhak
- 8,194
- 5
- 47
- 64
7
votes
2 answers
How to use Gradle "platforms" to align dependency versions in a multi-project setup?
I am trying to learn how to use “platforms” to align dependency versions between projects in a multi-project setup. So far I’ve…

Learner
- 1,215
- 1
- 11
- 26
0
votes
0 answers
BootJar not bundling all the dependencies including static files
I'm working on Gradle 7 able run my spring-boot app with eclipse and trying to create executable jar with all dependencies to run with java -jar command but I'm not able to achieve it and I'm new to gradle.What is needed to be added or changed in my…

THULASI RAM S
- 21
- 3
0
votes
0 answers
Gradle wait for a file to exist
Is there a way to make a task wait for a condition like for a file to exist?
Something like:
task checkDeployment() {
waitFor new File("results.txt").exist();
...
}

JuanKB1024
- 324
- 1
- 17
0
votes
1 answer
Gradle cucumber task is not recognizing cucumber steps
My build file looks like below and attaching my folder path.
When I run the task, It says undefined steps and Its asking to implement steps again.
enter image description here
I have created my own task in gradle to run cucumber test
task…

jeya suriyan
- 11
- 1
- 3
0
votes
1 answer
Groovy DSL convention object "Could not get unknown property"
I have the following code in my build.gradle:
class GreetingPlugin implements Plugin {
def void apply(Project project) {
project.convention.plugins.greeting = new GreetingPluginConvention()
project.task('hello') {
…

mzakrze
- 53
- 3
0
votes
0 answers
Is there a way to modify the entire content of the file while assembling the Jar using Gradle.?
There's an usecase in my project that, I have to modify the class file content while preparing the jar & use the custom classloader for loading that class.
To achieve the above scenario, I have used the following snippet of CopySpec in my…

Devendranadh Nalam
- 44
- 6
0
votes
1 answer
On passing a closure to a gradle extension, why the owner of closure is not the main Projects object?
I was looking at the closure scopes and found the output counter intuitive, this code was in build.gradle file
plugins {
id 'java'
}
sourceSets {
println 'source sets closure scopes this,owner, delegate'
println this.toString() //…

Paras Pathak
- 3
- 2
0
votes
1 answer
Gradle: Include the same SourceSet in Multiple subprojects
How would I add a single source set to multiple subprojects?
First of all ... yes I know how ridiculous this is. This is just something I have to do.
The setup
The project uses the Groovy DSL.
There are 3 subprojects (A,B,C), each with there own…

Pytry
- 6,044
- 2
- 37
- 56