I have 2 relatively simple Gradle 6.1.1 configs, one is using https://plugins.gradle.org/plugin/com.github.node-gradle.node to build a react app, and the other one is based on https://plugins.gradle.org/plugin/com.bmuschko.tomcat and runs a simple wicket app in embedded tomcat.
The 1st config for npm task is:
apply plugin: 'com.github.node-gradle.node'
node {
version = '12.16.0'
download = true
workDir = file "$project.buildDir/nodejs"
}
task "npmBuild"( type:NpmTask ) {
args = [ 'run', 'build' ]
}
and produces the following output in Windows 10:
>gradlew.bat npmBuild
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :npmBuild
> layer-selection@0.1.0 build .....
> react-scripts build
Creating an optimized production build...
Compiled with warnings.
...
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
File sizes after gzip:
90.99 KB build\static\js\2.17f9cda1.chunk.js
28.68 KB build\static\css\2.2f7f14af.chunk.css
3.43 KB build\static\js\main.1150707e.chunk.js
778 B build\static\js\runtime-main.989054bd.js
177 B build\static\css\main.f7c0afb8.chunk.css
...
Find out more about deployment here:
bit.ly/CRA-deploy
at this point the tasks lasted approx. 20 seconds, then it hangs for 3 min with CPU-load below 1% and continues:
BUILD SUCCESSFUL in 3m 18s
2 actionable tasks: 1 executed, 1 up-to-date
The strange thing is that running the same config on similar project on another Win10 machine results in clean run w/o freezes.
Also the tasks:
task "npm-install"( type:NpmTask ) {
args = [ 'install' ]
}
task "npm-set-proxy"( type:NpmTask ) {
args = [ 'config', 'set', 'https-proxy', 'http://www.www.www:80/' ]
}
show the same 3-extra-minutes behavior.
The 2nd config looks like:
apply plugin: 'com.bmuschko.tomcat'
ext.tomcatVersion = '9.0.30'
dependencies {
// some deps
tomcat "org.apache.tomcat.embed:tomcat-embed-core:$tomcatVersion",
"org.apache.tomcat.embed:tomcat-embed-logging-juli:9.0.0.M6",
"org.apache.tomcat.embed:tomcat-embed-jasper:$tomcatVersion",
"org.apache.tomcat:tomcat-jdbc:$tomcatVersion",
"org.apache.tomcat:tomcat-dbcp:$tomcatVersion"
'org.postgresql:postgresql:42.2.12'
'log4j:log4j:1.2.17'
}
tomcat {
httpProtocol = 'org.apache.coyote.http11.Http11Nio2Protocol'
ajpProtocol = 'org.apache.coyote.ajp.AjpNio2Protocol'
httpPort = 8088
}
and produces the output in Win10:
>gradlew.bat tomcatRun
> Configure project :
> Task :compileJava
> Task :processResources UP-TO-DATE
> Task :classes
> Task :tomcatRun
at this point it hangs for again for around 3 mins with CPU-load below 18% and then continues:
LOG .......
LOG 2020-04-24 12:45:10,971 [Execution worker for ':'] INFO : - ActiveMq URL tcp://localhost:61620
Started Tomcat Server
The Server is running at http://localhost:8088/racy10
<=========----> 75% EXECUTING [4m 2s]
So for no reason (from my POV) the gradle excecution hangs for 3 mins either after or before certain tasks.
Any hints and ideas are welcome!
TIA