Connection refused for outside repo


(Alex Gorbachenko) #1

Hey everyone,

So I am using Gradle version 3.2.1 and am trying to build jars using “gradlew jar”. When I first tried it, it worked successfully numerous times. I was able to delete and build jars without a problem. I don’t remember changing any settings anywhere and out of nowhere I started getting connection errors. I’m in a corporate environment but I have http and https variables set up in my system properties but like I said, it worked before without any problems.

Here is the error I get in the terminal:

:compileJava Error listing versions of org.mockito:mockito-core:1.+ using class org.gradle.api.internal.artifacts.repositories.resolver.MavenVersionLister$1. Will attempt an alternate way to list versions. This behaviour has been deprecated and is scheduled to be removed in Gradle 2.0

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all dependencies for configuration ‘:compile’.

Could not resolve org.mockito:mockito-core:1.+.
Required by:
:com.dotcms.spring:0.1 > com.dotcms:dotcms:3.6.0
Failed to list versions for org.mockito:mockito-core:1.+.
Could not list versions using M2 pattern ‘http://repo.dotcms.com/artifactory/libs-release/[organisation]/[module]/[revision]/[artifact]-revision.[ext]’.
Could not GET ‘http://repo.dotcms.com/artifactory/libs-release/org/mockito/mockito-core/’.
Connection to http://repo.dotcms.com refused

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 48.368 secs

Here is the build.gradle file:

apply plugin: 'application' apply plugin: 'osgi' apply plugin: 'war' apply plugin: 'eclipse' apply plugin: 'java'

sourceCompatibility = '1.8’
version = ‘0.1’

repositories {
maven {
url “http://repo.dotcms.com/artifactory/libs-release
}
}

dependencies {
compile fileTree(dir: ‘src/main/resources/libs’, include: ‘*.jar’)
compile (group: ‘com.dotcms’, name: ‘dotcms’, version: ‘3.6.0’){
transitive = true
}
providedCompile “javax.servlet:servlet-api:2.5”
}

jar {
manifest {
name = 'Osgi Custom service’
instruction ‘Bundle-Vendor’, 'dotcms’
instruction ‘Bundle-Description’, 'dotCMS - A bundle that creates a custom service’
instruction ‘Bundle-DocURL’, 'http://www.dotcms.com
instruction ‘Bundle-Activator’, 'com.dotmarketing.osgi.service.Activator’
instruction ‘DynamicImport-Package’, ‘'
instruction ‘Import-Package’, '
;version=0’
}
}

task wrapper(type: Wrapper) {
gradleVersion = ‘2.9’
}

If I enter the URL directly into my web browser it reaches the repo successfully.

Please let me know if you have any suggestions or if more information is needed. Thank you for the help in advance.


(Alex Gorbachenko) #4

Sorry, messed up the html part in the post and the console error wasn’t shown. Here it is:

:compileJava
Error listing versions of org.mockito:mockito-core:1.+ using class org.gradle.api.internal.artifacts.repositories.resolver.MavenVersionLister$1. Will attempt an alternate way to list versions. This behaviour has been deprecated and is scheduled to be removed in Gradle 2.0

FAILURE: Build failed with an exception.

What went wrong:
Could not resolve all dependencies for configuration ‘:compile’.
Could not resolve org.mockito:mockito-core:1.+.
Required by:
:com.dotcms.spring:0.1
com.dotcms:dotcms:3.6.0
Failed to list versions for org.mockito:mockito-core:1.+.
Could not list versions using M2 pattern ‘http://repo.dotcms.com/artifactory/libs-release/[organisation]/[module]/[revision]/[artifact]-revision.[ext]’.
Could not GET ‘http://repo.dotcms.com/artifactory/libs-release/org/mockito/mockito-core/’.
Connection to http://repo.dotcms.com refused

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 48.368 secs