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
Getting Data from Incoming Json in a Java Servlet
Rsa Decryption Error - Illegalblocksizeexception: Data Must Not Be Longer Than 128 Bytes
Android - Running a Background Task Every 15 Minutes, Even When Application Is Not Running
How to Return a List of Specific Type Instead of List<Object[]> in Hibernate
Http Post Request With Content Type Application/X-Www-Form-Urlencoded Not Working in Spring
Changing Scene When a Button Is Pressed Fxml
Reading a Text File Character by Character into a 2D Array in Java
How to Get Response as Json With Responseentity in Java
Broadcast Receiver Is Not Working When Application Is Removed from Background
Spring-Boot @Autowired Interface (Crudrepository) in My Service Class => Null Pointer Exception
Java Properties - How to Create Dynamic Properties
Subscript and Superscript a String in Android
How to Map an Auto Increment Field in Hibernate
Using Nested While Loop to Print Pyramid of Stars