Network is unreable in jenkinsfile in gradle test

in the topic, when jenkinfile is running in gradle plain clean build then could not resolve junit4.12…
Please any comment help.

Well, it seems your Jenkins is not connected to the network or needs some proxy settings.

Thanks Vampire,
In the proxy side, the red hat server is setting into $HOME/.gradle/gradle.properties havinf the proxy details and connect to jenkins agent… but the proxy details not picking up.

Gradle version - 6.9.1 and add to the PATH

What exactly do you set? Here you have the keys you should use: Gradle User Manual: Version 7.3.3

Is the file really on the right machine? You need to set it where the build agent is running the actual build, not on the server Jenkins is running on if that is different for you.

Is the file really in the location of the correct user that is used to execute the build?

Hello Vampire,
What exactly do you set? A Proxy in jenkins agent.
Is the file really in the location of the correct user that is used to execute the build? …SCM in jenkinsfile by pipeline through jenkins agent which added $HOME/.gradle/gradle.properties.
In jenkins agent, inside the gradle.properties, set up the proxy…but the jenkins agent is running the buils but failed due to network issue.

A Proxy in jenkins agent.

I meant which properties, to make sure you are setting them properly.

SCM in jenkinsfile by pipeline through jenkins agent which added $HOME/.gradle/gradle.properties.

I’m not a Jenkins expert. I greatly prefer using TeamCity which imho is much better.
So was that a yes?

And also, do you or Jenkins maybe change GRADLE_USER_HOME? Because actually it is not $HOME/.gradle/gradle.properties, but $GRADLE_USER_HOME/gradle.properties. It just happens that $HOME/.gradle is the default value for $GRADLE_USER_HOME on Linux systems.

You can also add these to your build script to double-check and then look at the output:

println("A: " + gradle.getGradleUserHomeDir().getAbsolutePath())
println("B: " + findProperty("systemProp.http.proxyHost"))
println("C: " + System.getProperty("http.proxyHost"))

You could even add reading the file and printing its content.