# Gradle build command failing - cannot resolve all dependencies

**URL:** <https://discuss.gradle.org/t/gradle-build-command-failing-cannot-resolve-all-dependencies/21361>\
**Category:** Help/Discuss\
**Created:** [January 26, 2017, 9:42pm UTC](https://discuss.gradle.org/t/gradle-build-command-failing-cannot-resolve-all-dependencies/21361 "2017-01-26T21:42:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![harish](https://avatars.discourse-cdn.com/v4/letter/h/47e85d/32.png) [@harish](https://discuss.gradle.org/u/harish)\
**Post date:** [January 26, 2017, 9:42pm UTC](https://discuss.gradle.org/t/gradle-build-command-failing-cannot-resolve-all-dependencies/21361/1 "2017-01-26T21:42:14Z")

</div>

I am trying to build my gradle project from command line but my build is failing with the following error:

C:\Users\kalihari\git\queueReceive\>gradle build  
:compileJava FAILED

FAILURE: Build failed with an exception.

- What went wrong:  
Could not resolve all dependencies for configuration ‘:compileClasspath’.

> Could not resolve com.solacesystems:sol-jms:10.+.  
> Required by:  
> project :  
> Could not resolve com.solacesystems:sol-jms:10.+.  
> Failed to list versions for com.solacesystems:sol-jms.  
> Unable to load Maven meta-data from [https://repo1.maven.org/maven2/co](https://repo1.maven.org/maven2/co)  
> m/solacesystems/sol-jms/maven-metadata.xml.  
> Could not GET ‘[https://repo1.maven.org/maven2/com/solacesystems/so](https://repo1.maven.org/maven2/com/solacesystems/so)  
> l-jms/maven-metadata.xml’.  
> Connect to [repo1.maven.org:443](http://repo1.maven.org:443) [[repo1.maven.org/151.101.40.209](http://repo1.maven.org/151.101.40.209)]  
> failed: Connection timed out: connect  
> Could not resolve com.solacesystems:sol-jcsmp:10.+.  
> Required by:  
> project :  
> Could not resolve com.solacesystems:sol-jcsmp:10.+.  
> Failed to list versions for com.solacesystems:sol-jcsmp.  
> Unable to load Maven meta-data from [https://repo1.maven.org/maven2/co](https://repo1.maven.org/maven2/co)  
> m/solacesystems/sol-jcsmp/maven-metadata.xml.  
> Could not GET ‘[https://repo1.maven.org/maven2/com/solacesystems/so](https://repo1.maven.org/maven2/com/solacesystems/so)  
> l-jcsmp/maven-metadata.xml’.  
> Connect to [repo1.maven.org:443](http://repo1.maven.org:443) [[repo1.maven.org/151.101.40.209](http://repo1.maven.org/151.101.40.209)]  
> failed: Connection timed out: connect  
> Could not resolve joda-time:joda-time:2.2.  
> Required by:  
> project :  
> Could not resolve joda-time:joda-time:2.2.  
> Could not get resource ‘[https://repo1.maven.org/maven2/joda-time/joda-ti](https://repo1.maven.org/maven2/joda-time/joda-ti)  
> me/2.2/joda-time-2.2.pom’.  
> Could not HEAD ‘[https://repo1.maven.org/maven2/joda-time/joda-time/2](https://repo1.maven.org/maven2/joda-time/joda-time/2).  
> 2/joda-time-2.2.pom’.  
> Connect to [repo1.maven.org:443](http://repo1.maven.org:443) [[repo1.maven.org/151.101.20.209](http://repo1.maven.org/151.101.20.209)] fa  
> iled: Connection timed out: connect

- 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: 1 mins 32.038 secs

C:\Users\kalihari\git\queueReceive\>gradle build  
:compileJava FAILED

FAILURE: Build failed with an exception.

- What went wrong:  
Could not resolve all dependencies for configuration ‘:compileClasspath’.

> Could not resolve com.solacesystems:sol-jms:10.+.  
> Required by:  
> project :  
> Could not resolve com.solacesystems:sol-jms:10.+.  
> Failed to list versions for com.solacesystems:sol-jms.  
> Unable to load Maven meta-data from [https://jcenter.bintray.com/com/s](https://jcenter.bintray.com/com/s)  
> olacesystems/sol-jms/maven-metadata.xml.  
> Could not GET ‘[https://jcenter.bintray.com/com/solacesystems/sol-j](https://jcenter.bintray.com/com/solacesystems/sol-j)  
> ms/maven-metadata.xml’.  
> Connect to [jcenter.bintray.com:443](http://jcenter.bintray.com:443) [[jcenter.bintray.com/75.126](http://jcenter.bintray.com/75.126).  
> 118.188] failed: Connection timed out: connect  
> Could not resolve com.solacesystems:sol-jcsmp:10.+.  
> Required by:  
> project :  
> Could not resolve com.solacesystems:sol-jcsmp:10.+.  
> Failed to list versions for com.solacesystems:sol-jcsmp.  
> Unable to load Maven meta-data from [https://jcenter.bintray.com/com/s](https://jcenter.bintray.com/com/s)  
> olacesystems/sol-jcsmp/maven-metadata.xml.  
> Could not GET ‘[https://jcenter.bintray.com/com/solacesystems/sol-j](https://jcenter.bintray.com/com/solacesystems/sol-j)  
> csmp/maven-metadata.xml’.  
> Connect to [jcenter.bintray.com:443](http://jcenter.bintray.com:443) [[jcenter.bintray.com/75.126](http://jcenter.bintray.com/75.126).  
> 118.188] failed: Connection timed out: connect  
> Could not resolve joda-time:joda-time:2.2.  
> Required by:  
> project :  
> Could not resolve joda-time:joda-time:2.2.  
> Could not get resource ‘[https://jcenter.bintray.com/joda-time/joda-time/](https://jcenter.bintray.com/joda-time/joda-time/)  
> 2.2/joda-time-2.2.pom’.  
> Could not HEAD ‘[https://jcenter.bintray.com/joda-time/joda-time/2.2/j](https://jcenter.bintray.com/joda-time/joda-time/2.2/j)  
> oda-time-2.2.pom’.  
> Connect to [jcenter.bintray.com:443](http://jcenter.bintray.com:443) [[jcenter.bintray.com/52.10.160](http://jcenter.bintray.com/52.10.160).  
> 119, [jcenter.bintray.com/54.186.235.10](http://jcenter.bintray.com/54.186.235.10)] failed: Connection timed out: connect

- 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: 1 mins 52.462 secs

C:\Users\kalihari\git\queueReceive\>gradle build  
:compileJava FAILED

FAILURE: Build failed with an exception.

- What went wrong:  
Could not resolve all dependencies for configuration ‘:compileClasspath’.

> Could not resolve com.solacesystems:sol-jms:10.+.  
> Required by:  
> project :  
> Could not resolve com.solacesystems:sol-jms:10.+.  
> Failed to list versions for com.solacesystems:sol-jms.  
> Unable to load Maven meta-data from [https://jcenter.bintray.com/com/s](https://jcenter.bintray.com/com/s)  
> olacesystems/sol-jms/maven-metadata.xml.  
> Could not GET ‘[https://jcenter.bintray.com/com/solacesystems/sol-j](https://jcenter.bintray.com/com/solacesystems/sol-j)  
> ms/maven-metadata.xml’.  
> Connect to [jcenter.bintray.com:443](http://jcenter.bintray.com:443) [[jcenter.bintray.com/52.10.1](http://jcenter.bintray.com/52.10.1)  
> 60.119, [jcenter.bintray.com/54.186.235.10](http://jcenter.bintray.com/54.186.235.10)] failed: Connection timed out: connect

> Could not resolve com.solacesystems:sol-jcsmp:10.+.  
> Required by:  
> project :  
> Could not resolve com.solacesystems:sol-jcsmp:10.+.  
> Failed to list versions for com.solacesystems:sol-jcsmp.  
> Unable to load Maven meta-data from [https://jcenter.bintray.com/com/s](https://jcenter.bintray.com/com/s)  
> olacesystems/sol-jcsmp/maven-metadata.xml.  
> Could not GET ‘[https://jcenter.bintray.com/com/solacesystems/sol-j](https://jcenter.bintray.com/com/solacesystems/sol-j)  
> csmp/maven-metadata.xml’.  
> Connect to [jcenter.bintray.com:443](http://jcenter.bintray.com:443) [[jcenter.bintray.com/52.10.1](http://jcenter.bintray.com/52.10.1)  
> 60.119, [jcenter.bintray.com/54.186.235.10](http://jcenter.bintray.com/54.186.235.10)] failed: Connection timed out: connect

> Could not resolve joda-time:joda-time:2.2.  
> Required by:  
> project :  
> Could not resolve joda-time:joda-time:2.2.  
> Could not get resource ‘[https://jcenter.bintray.com/joda-time/joda-time/](https://jcenter.bintray.com/joda-time/joda-time/)  
> 2.2/joda-time-2.2.pom’.  
> Could not HEAD ‘[https://jcenter.bintray.com/joda-time/joda-time/2.2/j](https://jcenter.bintray.com/joda-time/joda-time/2.2/j)  
> oda-time-2.2.pom’.  
> Connect to [jcenter.bintray.com:443](http://jcenter.bintray.com:443) [[jcenter.bintray.com/54.186.235](http://jcenter.bintray.com/54.186.235)  
> .10, [jcenter.bintray.com/52.10.160.119](http://jcenter.bintray.com/52.10.160.119)] failed: Connection timed out: connect

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

BUILD FAILED

Tried with both maven and jcenter repositories but it is still failing.

Following is my build.gradle file:

group ‘com,.barclays.queueReceive’  
version ‘1.0-SNAPSHOT’

apply plugin: ‘java’  
apply plugin: ‘application’  
mainClassName = ‘queueReceive.queueMessageReceiver’

sourceCompatibility = 1.8  
targetCompatibility = 1.8

repositories {  
jcenter()  
}

jar {  
baseName = ‘gs-gradle’  
version = ‘0.1.0’  
}

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

dependencies {  
compile(“com.solacesystems:sol-jms:10.+”)  
compile(“com.solacesystems:sol-jcsmp:10.+”)  
compile (“joda-time:joda-time:2.2”)  
testCompile group: ‘junit’, name: ‘junit’, version: ‘4.11’  
}

I am actually trying to create a jar file so that anyone can run my code without having to install gradle. But I am not able to create a jar file and my build command is throwing errors.

Can someone please help?
