Connection timeout error for maven repo in gradle - java

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.

Related

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'

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

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'

Gradle Build failed for Spring Boot project

I am new to Gradle.I am using Gradle 4.3 version.I am trying to configure a spring -boot application using gradle but it getting failed during project build phase.
Please find below my build.gradle file:
plugins {
id "org.springframework.boot" version "1.5.10.RELEASE"
}
apply plugin: 'java-library'
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
testImplementation 'junit:junit:4.12'
compile(
'org.springframework.boot:spring-boot-starter-actuator',
'org.springframework.boot:spring-boot-starter-web',
'org.apache.tomcat.embed:tomcat-embed-jasper',
'org.springframework.boot:spring-boot-starter-thymeleaf'
)
}
}
During gradle building from eclipse I am using build command,I am getting following error in eclipse console:
Working Directory: D:\Maven_Workspace\AddGradleViewer
Gradle User Home: C:\Users\Sumit\.gradle
Gradle Distribution: Local installation at C:\Users\Sumit\.gradle\wrapper\dists\gradle-4.3
Gradle Version: 4.3
Java Home: C:\Java\Java8\Jre8
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: true
Offline Mode Enabled: false
Gradle Tasks: build
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter-actuator:.
Searched in the following locations:
https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-actuator//spring-boot-starter-actuator-.pom
https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-actuator//spring-boot-starter-actuator-.jar
Required by:
project :
> Could not find org.springframework.boot:spring-boot-starter-web:.
Searched in the following locations:
https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.pom
https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web//spring-boot-starter-web-.jar
Required by:
project :
> Could not find org.apache.tomcat.embed:tomcat-embed-jasper:.
Searched in the following locations:
https://repo1.maven.org/maven2/org/apache/tomcat/embed/tomcat-embed-jasper//tomcat-embed-jasper-.pom
https://repo1.maven.org/maven2/org/apache/tomcat/embed/tomcat-embed-jasper//tomcat-embed-jasper-.jar
Required by:
project :
> Could not find org.springframework.boot:spring-boot-starter-thymeleaf:.
Searched in the following locations:
https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-thymeleaf//spring-boot-starter-thymeleaf-.pom
https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-thymeleaf//spring-boot-starter-thymeleaf-.jar
Required by:
project :
Can anyone provide any suitable solution to this?

Could not resolve all dependencies for configuration ':compileClasspath'. Find for dependencies inside jar in CircleCI build

I am getting this error in my CircleCI build.
* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not find com.monederobingo:libs:0.0.1.
Required by:
project :
com.monederobingo:libs:0.0.1 is a library that only exists in my local maven .m2 directory.
I have this dependency specified in my gradle.config.
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
...
compile 'com.monederobingo:libs:0.0.1'
}
Is there a way to include this jar in CircleCI build?
UPDATE: I have tried to include the jar in the project using these steps: https://discuss.gradle.org/t/how-to-include-dependencies-in-jar/19571/5
However, I'm still getting the same error in Circle CI build.

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