Gradle Could Not Resolve Org.Springframework.Boot:Spring-Boot-Gradle-Plugin:1.4.2.Release (Repo1.Maven.Org: Nome O Servizio Sconosciuto)

Gradle Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE (repo1.maven.org: Nome o servizio sconosciuto)

As the error tells you Nome o servizio sconosciuto, repo1.maven.org cannot be resolved via DNS. So you have some networking problem or you need to use a proxy server which you did not configure for Gradle. Ask your IT support as to why you cannot resolve the hostname.

Could not find org.springframework.boot:spring-boot-dependencies:2.6.1

Thanks to @granadaCoder above, and after reinstalling Gradle to the latest version 7.3.3 the actual problem was that a 2nd repositories setting had crept into my build.gradle

repositories {
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}

Which was exactly where the error said the dependencies were not found. I changed this to

repositories {
mavenCentral()
}

Things then started to work.

Gradle cannot find plugin, Spring boot project initialized using Spring initializer

Turns out the issue really was with SSL, or rather with my cacerts file.

Replacing the plugins block with buildscript provided better logging, including the following:

Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

I then found this thread: https://github.com/AdoptOpenJDK/openjdk-build/issues/478

To summarize, it says certain builds of OpenJDK don't have cacerts in them by default, for Windows. Sure enough, my cacerts file was only 32 bytes long :)

I have updated my OpenJDK version and things are working fine now. One could also import cacerts from other places. Thanks to everyone that responded to the question.

That being said, the problem would have been discovered sooner if only the plugins block provided better debug logging.

build.gradle created by spring initializr error message on import function

The build.gradle in your question matches the expected output from start.spring.io except these two lines:

// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies
import group: 'org.springframework.cloud', name: 'spring-cloud-dependencies', version: '2021.0.0', ext: 'pom'

This is not valid Gradle syntax. Simply removing them will fix the issue at hand.



Related Topics



Leave a reply



Submit