Gradle Could not resolve org.springframework.boot:spring-boot-dependencies: - java

I'm getting some errors :
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':gisett-backend:compileJava'.
> Could not resolve all dependencies for configuration ':gisett-backend:detachedConfiguration1'.
> Could not resolve org.springframework.boot:spring-boot-dependencies:2.0.3.RELEASE.
Required by:
project :gisett-backend
> Could not resolve org.springframework.boot:spring-boot-dependencies:2.0.3.RELEASE.
> Could not get resource 'http://repo.boundlessgeo.com/main/org/springframework/boot/spring-boot-dependencies/2.0.3.RELEASE/spring-boot-dependencies-2.0.3.RELEASE.pom'.
> Could not HEAD 'http://repo.boundlessgeo.com/main/org/springframework/boot/spring-boot-dependencies/2.0.3.RELEASE/spring-boot-dependencies-2.0.3.RELEASE.pom'.
> No such host is known (repo.boundlessgeo.com)
> Could not resolve org.springframework.boot:spring-boot-dependencies:2.0.3.RELEASE.
> Could not get resource 'http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-dependencies/2.0.3.RELEASE/spring-boot-dependencies-2.0.3.RELEASE.pom'.
> Could not HEAD 'http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-dependencies/2.0.3.RELEASE/spring-boot-dependencies-2.0.3.RELEASE.pom'. Received status code 501 from server: HTTPS Required
How can I fix it?
UPDATE:
It helped partially, now I get:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':gisett-backend'.
> Could not resolve all artifacts for configuration ':gisett-backend:classpath'.
> Could not resolve io.spring.gradle:propdeps-plugin:0.0.9.RELEASE.
Required by:
project :gisett-backend
> Could not resolve io.spring.gradle:propdeps-plugin:0.0.9.RELEASE.
> Could not get resource 'https://repo.spring.io/libs-snapshot/io/spring/gradle/propdeps-plugin/0.0.9.RELEASE/propdeps-plugin-0.0.9.RELEASE.pom'.
> Could not HEAD 'https://repo.spring.io/libs-snapshot/io/spring/gradle/propdeps-plugin/0.0.9.RELEASE/propdeps-plugin-0.0.9.RELEASE.pom'. Received status code 401 from server: Unauthorized
Update 2:
I fixed it (I updated a list of servers ) but now another error :
A problem occurred configuring project ':gisett-backend'.
Could not resolve all artifacts for configuration ':gisett-backend:classpath'.
Could not find io.spring.gradle:propdeps-plugin:0.0.9.RELEASE.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/io/spring/gradle/propdeps-plugin/0.0.9.RELEASE/propdeps-plugin-0.0.9.RELEASE.pom
- https://repo.spring.io/snapshot/io/spring/gradle/propdeps-plugin/0.0.9.RELEASE/propdeps-plugin-0.0.9.RELEASE.pom
- https://plugins.gradle.org/m2/io/spring/gradle/propdeps-plugin/0.0.9.RELEASE/propdeps-plugin-0.0.9.RELEASE.pom
this is the part from build.gradle:
buildscript {
ext {
springBootVersion = '2.0.1.BUILD-SNAPSHOT'
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/snapshot/' }
maven { url "https://plugins.gradle.org/m2/" }
//for finding propdeps-plugin dependency
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "com.moowork.gradle:gradle-node-plugin:1.2.0"
// classpath 'io.spring.gradle:propdeps-plugin:0.0.9.RELEASE'
}
}
//...
// In this section you declare where to find the dependencies of your project
repositories {
maven { url "https://repo.spring.io/plugins-release" }
//...
maven { url "https://repo.maven.apache.org/maven2" }
}
}
//...
How can I fix it?
Thanks

Try to change your build.gradle should look something like this:
buildscript {
ext {
springBootVersion = '2.0.3.BUILD-SNAPSHOT'
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/libs-snapshot' }
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
}
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

Related

Connection timeout error for maven repo in gradle

I am getting below error when Jenkins pipeline is run :
Welcome to Gradle 7.0!
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'Auth-mapper'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.7.7.
Required by:
project :
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.7.7.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/2.7.7/spring-boot-gradle-plugin-2.7.7.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/2.7.7/spring-boot-gradle-plugin-2.7.7.pom'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/146.75.32.215] failed: connect timed out
> Could not resolve io.spring.gradle:dependency-management-plugin:1.1.0.
Required by:
project :
> Could not resolve io.spring.gradle:dependency-management-plugin:1.1.0.
my build.gradle file is having these entries :
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.7.7"
classpath "io.spring.gradle:dependency-management-plugin:1.1.0"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.0"
}
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"
apply plugin: "org.sonarqube"
When I run this application in local then its working fine but when I try deploying it to openshift via Jenkins then in the build step its failing due to the above issue.
Below configuration in gradle.properties based on above comments worked for me ...
systemProp.https.proxyHost
systemProp.https.proxyPort
systemProp.http.nonProxyHosts
The above properties values needs to be set based on company specific configuration.

Unable to compile minecraft mod: Could not resolve all files for configuration ':classpath'

I was downloading a mod from GitHub (Tetra pack https://github.com/Noobulus/Tetra-Pak/tree/1.18) because the 1.18 version was not yet released as a compiled jar.
I ran the gradlew build but It threw this error
A problem occurred configuring root project 'Tetra-Pak-1.18'.
Could not resolve all files for configuration ':classpath'.
Could not resolve com.github.gmazzo:gradle-buildconfig-plugin:3.0.1.
Required by:
project : > com.github.gmazzo.buildconfig:com.github.gmazzo.buildconfig.gradle.plugin:3.0.1
Could not resolve com.github.gmazzo:gradle-buildconfig-plugin:3.0.1.
Could not get resource 'https://dist.creeper.host/Sponge/maven/com/github/gmazzo/gradle-buildconfig-plugin/3.0.1/gradle-buildconfig-plugin-3.0.1.pom'.
Could not HEAD 'https://dist.creeper.host/Sponge/maven/com/github/gmazzo/gradle-buildconfig-plugin/3.0.1/gradle-buildconfig-plugin-3.0.1.pom'.
Read timed out
here is the buildscript from build.Gradle.
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
mavenCentral()
maven { url = 'https://dist.creeper.host/Sponge/maven' }
maven { url = 'https://repo.spongepowered.org/maven' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
}
}
Solved! I just removed the dependency that was giving the error from build.gradle.

Could not find android.arch.lifecycle:extensions:2.1.0. Required by: project :app > com.paypal.checkout:android-sdk:0.1.0

I'm try to install paypalcheckout sdk in andorid project from below link,
https://developer.paypal.com/docs/business/native-checkout/android/
I'm also adding this to dependencies in gradle app module file
implementation 'com.paypal.checkout:android-sdk:0.2.0' & rebuild project but it won't be able to build
In project gradle file code
allprojects {
repositories {
jcenter()
google()
mavenCentral()
maven {
url "https://maven.google.com"
}
maven {
url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
credentials {
// Be sure to add these non-sensitive credentials in order to retrieve dependencies from
// the private repository.
username 'paypal_sgerritz'
password 'AKCp8jQ8tAahqpT5JjZ4FRP2mW7GMoFZ674kGqHmupTesKeAY2G8NcmPKLuTxTGkKjDLRzDUQ'
}
}
maven { url 'https://maven.fabric.io/public' }
}
}
when I build android project it says error
Execution failed for task ':app:preDebugBuild'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find android.arch.lifecycle:extensions:2.1.0.
Required by:
project :app > com.paypal.checkout:android-sdk:0.1.0
> Could not find android.arch.lifecycle:runtime:2.1.0.
Required by:
project :app > com.paypal.checkout:android-sdk:0.1.0
> Could not find android.arch.lifecycle:runtime:2.1.0.
Required by:
project :app > com.android.support:support-v4:28.0.0 > com.android.support:support-compat:28.0.0
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
I'm new to android.Suggest me some solution to solve this.
May be you are missing to add dependencies in your app level build.gradle
implementation 'android.arch.lifecycle:extensions:2.1.0'
implementation 'android.arch.lifecycle:runtime:2.1.0'

org.gradle.initialization.DefaultSettings_Decorated cannot be cast to org.gradle.api.internal.project.ProjectInternal

I tried to create spring boot application:
I selected components I need from https://start.spring.io/
Now I want to build the application and it fall downs:
FAILURE: Build failed with an exception.
* Where:
Settings file 'D:\objectsharingsystem\settings.gradle' line: 2
* What went wrong:
A problem occurred evaluating settings 'object-sharing-system'.
> Failed to apply plugin [id 'org.gradle.java']
> org.gradle.initialization.DefaultSettings_Decorated cannot be cast to org.gradle.api.internal.project.ProjectInternal
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
settings.gradle:
rootProject.name = 'object-sharing-system'
apply plugin: 'java'
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
build.gradle:
buildscript {
ext {
springBootVersion = '2.0.0.BUILD-SNAPSHOT'
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-jdbc')
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.boot:spring-boot-starter-validation')
compile('org.springframework.boot:spring-boot-starter-web')
runtime('com.microsoft.sqlserver:mssql-jdbc')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
Please help to find mistake.
settings.gradle can not handle application of Project level plugin.
Remove apply plugin and compileJava from settings.gradle.
You already have your sourceCompatibility set in build.gradle
See here where it says
method calls within the settings file is delegated to a settings object. Look at the Settings class in the API documentation for more information.
Unlike build.gradle, the apply method in settings.gradle expects a Plugin<Settings> and not a Plugin<Project>. The java plugin is a Plugin<Project> and can't be applied like this in settings.gradle

Gradle Drools 6.2 Could not resolve all dependencies for configuration ':compile'

I'm trying to pull in Drools 6.2 using gradle and keep getting the following error. I read that it could be an issue with repos that have poms, but not jars, but that doesn't seem to be the case. Frankly I'm a bit stuck and don't know how to proceed here.
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.kie:kie-api:6.2.0.Final.
Required by:
1:1:1
> Could not resolve org.kie:kie-api:6.2.0.Final.
> Could not parse POM http://repo1.maven.org/maven2/org/kie/kie-api/6.2.0.Final/kie-api-6.2.0.Final.pom
> Could not resolve org.kie:kie-api-parent:6.2.0.Final.
> Could not resolve org.kie:kie-api-parent:6.2.0.Final.
> Could not parse POM http://repo1.maven.org/maven2/org/kie/kie-api-parent/6.2.0.Final/kie-api-parent-6.2.0.Final.pom
> Could not resolve org.kie:kie-parent-with-dependencies:6.2.0.Final.
> Could not resolve org.kie:kie-parent-with-dependencies:6.2.0.Final.
> Could not parse POM http://repo1.maven.org/maven2/org/kie/kie-parent-with-dependencies/6.2.0.Final/kie-parent-with-dependencies-6.2.0.Final.pom
> Could not find org.jboss.dashboard-builder:dashboard-builder-bom:6.2.0.Final.
Searched in the following locations:
http://repo1.maven.org/maven2/org/jboss/dashboard-builder/dashboard-builder-bom/6.2.0.Final/dashboard-builder-bom-6.2.0.Final.pom
http://repo1.maven.org/maven2/org/jboss/dashboard-builder/dashboard-builder-bom/6.2.0.Final/dashboard-builder-bom-6.2.0.Final.jar
Here is my build.gradle:
apply plugin: 'java'
apply plugin: 'eclipse'
group = '1'
version = '1'
description = ""
repositories {
maven {
url 'http://repo1.maven.org/maven2'
artifactUrls 'http://repository.jboss.org/nexus/content/groups/public-jboss'
}
}
ext {
droolsVersion = '6.2.0.Final'
}
dependencies {
compile "org.kie:kie-api:$droolsVersion"
compile "org.drools:drools-core:$droolsVersion"
compile "org.drools:drools-compiler:$droolsVersion"
}
I've also tried:
repositories {
mavenCentral()
}
EDIT:
For future googlers, we determined that Drools is a very poor match for Gradle. We had to cobble together a number of hacks to keep it working, and ended up switching to Maven. As with all things, YMMV.
If you want to tell gradle to look at different locations you should write the repositories like this:
repositories {
maven {
name 'central'
url 'http://repo1.maven.org/maven2'
}
maven {
name 'jboss'
url 'http://repository.jboss.org/nexus/content/groups/public-jboss'
}
}

Categories