When building my project with gradle, it gets stuck on the processResources task.
I have a multi project setup: i have a root with under that 3 projects: adminutils-common, adminutils-fabric and adminutils-bukkit.
When i run the build task, it works, until it gets to any of the processResources tasks, it just stays on that task forever, it just never stops, one time it was still on the task after 18 minutes.
It also does this if i somehow skip adminutils-bukkit and it gets to adminutils-fabric. When i run it with
–debug it constantly logs something (I would upload picture, but can only do 1 media embed, so you can find it in the gist).
Here is a gist with some important files, does someone know why it’s getting stuck?
“the thing it logs” is nothing interesting.
Just regular maintenance task of an idle daemon.
This shows nothing interesting at all.
Maybe you should start with ruling out the IDE and run the build from commandline to see whether it behaves idffernetly there.
From a very cursory look I don’t see anything suspicious.
If it also happens from commandline, you might consider using the GitHub - gradle/gradle-profiler: A tool for gathering profiling and benchmarking information for Gradle builds to gain more insight on what is happening.
From what it looks like it also does this from commandline, I will use the tool today, i will update you if i have used it.
Ok so a bit late, I forgot to post and was a bit busy, but when I ran it with the profiler it got stuck too because it just keeps getting stuck on processResources, so that won’t help the problem.
Of course it also gets stuck, but you can use the profiler to see where it is stuck, what is stuck exactly.
It just shows the processResources task, where would i see where it is stuck?
Well, use the profiler?
Alternatively, you can maybe also run through debugger and look at a thread dump
Ok, so I misunderstood it at first, but what profiler should i use? Like what is the best for the place of <>
?
So I ran it with this command to try.
I started it at 15:59 as you can see and I ended it at 19:50 (I forgot that i still had it running).
* Started at 2024-02-25T15:59:10.933988600Z
* Settings
Project dir: C:\Users\elect\IdeaProjects\AdminUtils
Output dir: C:\Users\elect\IdeaProjects\AdminUtils\profile-out-2
Profiler: buildscan
Benchmark: false
Versions: []
Gradle User Home: C:\Users\elect\IdeaProjects\AdminUtils\gradle-user-home
Targets: [build]
* Inspecting the build using its default Gradle version
> Configure project :adminutils-fabric
Fabric Loom: 1.5.7
> Task :help
Welcome to Gradle 8.4.
To run a build, run gradle <task> ...
To see a list of available tasks, run gradle tasks
To see more detail about a task, run gradle help --task <task>
To see a list of command-line options, run gradle --help
For more detail on using Gradle, see https://docs.gradle.org/8.4/userguide/command_line_interface.html
For troubleshooting, visit https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD SUCCESSFUL in 19s
1 actionable task: 1 executed
* Stopping daemons
Running command C:\Users\elect\IdeaProjects\AdminUtils\gradle-user-home\wrapper\dists\gradle-8.4-bin\1w5dpkrfk8irigvoxmyhowfim\gradle-8.4\bin\gradle.bat --stop --gradle-user-home C:\Users\elect\IdeaProjects\AdminUtils\gradle-user-home
Stopping Daemon(s)
1 Daemon stopped
* Scenarios
Scenario: using Gradle 8.4
Gradle 8.4 (C:\Users\elect\IdeaProjects\AdminUtils\gradle-user-home\wrapper\dists\gradle-8.4-bin\1w5dpkrfk8irigvoxmyhowfim\gradle-8.4)
Run using: Tooling API
Run: run tasks build
Cleanup: do nothing
Gradle args: []
Build changes: []
Warm-ups: 2
Builds: 1
* Running scenario using Gradle 8.4 (scenario 1/1)
* Stopping daemons
Running command C:\Users\elect\IdeaProjects\AdminUtils\gradle-user-home\wrapper\dists\gradle-8.4-bin\1w5dpkrfk8irigvoxmyhowfim\gradle-8.4\bin\gradle.bat --stop --gradle-user-home C:\Users\elect\IdeaProjects\AdminUtils\gradle-user-home
No Gradle daemons are running.
* Build details
Gradle version: Gradle 8.4
Java home: C:\Program Files\Eclipse Adoptium\jdk-17.0.8.101-hotspot
OS: windows 11 amd64 10.0
JVM args:
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED
--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED
--add-opens=java.base/java.nio.charset=ALL-UNNAMED
--add-opens=java.base/java.net=ALL-UNNAMED
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
-Xmx2G
-Dfile.encoding=windows-1252
-Duser.country=GB
-Duser.language=en
-Duser.variant
-Dorg.gradle.profiler.scenario=default
Gradle args:
--gradle-user-home
C:\Users\elect\IdeaProjects\AdminUtils\gradle-user-home
-I
C:\Users\elect\AppData\Local\Temp\gradleProfiler8710513070485810057.gradle
-I
C:\Users\elect\AppData\Local\Temp\gradleProfilerGradleEnterpriseInitScript5518997758618047437.gradle
* Running warm-up build #1
> Configure project :adminutils-fabric
Fabric Loom: 1.5.7
> Task :javadoc NO-SOURCE
> Task :javadocJar
> Task :assemble
> Task :check UP-TO-DATE
> Task :build
> Task :adminutils-common:compileJava UP-TO-DATE
> Task :adminutils-common:processResources NO-SOURCE
> Task :adminutils-common:classes UP-TO-DATE
> Task :adminutils-common:jar
> Task :adminutils-bukkit:compileJava UP-TO-DATE
> Task :adminutils-bukkit:processResources
Ok, so I misunderstood it at first, but what profiler should i use?
Whichever you are most familiar with or have a license for.
buildscan
is not a profiler.
What I meant is using one of the actual profilers that are supported and then use the profiler to find out what is happening.
I am not familiar with any of them and don’t even really know what they do. Can you recommend one?
Of the ones I know, I like JProfiler the most.
I don’t really get how it works, it shows all these tabs but don’t know where i can find what i need.
I’m sorry, but this is a Gradle forum, not a profiler teaching place, so I’m not going to teach you how to use a profiler.
A profiler is an essential tool for any software developer that helps you to find out where your program spends its time, where it consumes the memory, where you might have memory leaks, and many other things, so you should learn how to use one anyway, just not here.