Search code examples
javaspring-bootgradle

Could not fetch model of type 'BuildEnvironment' using Gradle distribution


I'm getting the below error when I have imported a gradle project and tried refreshing it. I'm new to gradle and using gradle wrapper. also, the gradle distribution exists in the repository.

Could not fetch model of type 'BuildEnvironment' using Gradle distribution 'http://repository.xyz.com:8080/artifactory/gradle-distributions/gradle-4.8.1-all.zip'. The specified Gradle distribution 'http://repository.xyz.com:8081/artifactory/gradle-distributions/gradle-4.8.1-all.zip' does not exist. http://repository.xyz.com:8080/artifactory/gradle-distributions/gradle-4.8.1-all.zip


Solution

  • open gradle/wrapper/gradle-wrapper.properties and set a proper distributionUrl there:

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip