Showing posts with label Gradle. Show all posts
Showing posts with label Gradle. Show all posts

Gradle Could not create service of type ScriptPluginFactory

Error

Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().


Detailed exception

[jj@184fc3b978cc bigtop]$ ./gradlew clean

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.createCrossBuildFileHashCache().

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s

Solution

The directory where code was there was owned by root:root

Change the ownership back to your user and it should work

Gradle proxy settings

If you are behind the corporate proxy, you can configure Gradle to use the proxy by following settings.

Create a file called ~/.gradle/gradle.properties

Generally is in «USER_HOME»/.gradle/gradle.properties, where «USER_HOME» is your home directory.
That’s typically one of the following, depending on your platform:
C:\Users\<username> (Windows Vista & 7+)
/Users/<username> (macOS)
/home/<username> (Linux)

Add the settings related to proxy.

systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost

Also add the HTTPS proxy settings

systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost

If your proxy is a CNTLM then you can also configure

* Set the http.proxyUser system property to a value like domain/username.
• Provide the authentication domain via the http.auth.ntlm.domain system property.