Build.gradle always failed when testng dependency is added

Hi,

As my tests were failed due to dependency with Text NG, i tried adding testng(with different versions) related URL in the dependency section of build gradle, but the build always failed.Refer the console errors below:
Gradle.build file
apply plugin: ‘java’
apply plugin: ‘maven’
apply plugin: ‘eclipse’

repositories {

 maven { url "http://repo.experitest.com:8010/Maven2/" }
 maven { url "http://repo.maven.apache.org/maven2" }
 maven { url 'http://mvnrepository.com/maven2' }
 mavenCentral()

}
dependencies {
compile group: ‘com.experitest’, name: ‘seetest-appium’, version:‘10.8.28’
compile group: ‘com.experitest’, name: ‘hamcrest-core’, version:‘1.3’
compile group: ‘org.testng’, name: ‘testng’, version: ‘6.8.8’**

}

Console errors:

FAILURE: Build failed with an exception.

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

Could not resolve org.testng:testng:6.8.8.
Required by:
project :
Could not resolve org.testng:testng:6.8.8.
Could not get resource ‘http://repo.experitest.com:8010/Maven2/org/testng/testng/6.8.8/testng-6.8.8.pom’.
Could not GET ‘http://repo.experitest.com:8010/Maven2/org/testng/testng/6.8.8/testng-6.8.8.pom’.
Connect to repo.experitest.com:8010 [repo.experitest.com/207.232.40.121] failed: Connection timed out: connect
Could not resolve org.testng:testng:6.8.8.
Could not get resource ‘http://repo.maven.apache.org/maven2/org/testng/testng/6.8.8/testng-6.8.8.pom’.
Could not GET ‘http://repo.maven.apache.org/maven2/org/testng/testng/6.8.8/testng-6.8.8.pom’.
Connect to repo.maven.apache.org:80 [repo.maven.apache.org/151.101.40.215] failed: Connection timed out: connect
Could not resolve org.testng:testng:6.8.8.
Could not get resource ‘http://mvnrepository.com/maven2/org/testng/testng/6.8.8/testng-6.8.8.pom’.
Could not GET ‘http://mvnrepository.com/maven2/org/testng/testng/6.8.8/testng-6.8.8.pom’.
Connect to mvnrepository.com:80 [mvnrepository.com/52.200.112.100, mvnrepository.com/52.45.21.209] failed: Connection timed out: connect
Could not resolve org.testng:testng:6.8.8.
Could not get resource ‘https://repo1.maven.org/maven2/org/testng/testng/6.8.8/testng-6.8.8.pom’.
Could not GET ‘https://repo1.maven.org/maven2/org/testng/testng/6.8.8/testng-6.8.8.pom’.
Connect to repo1.maven.org:443 [repo1.maven.org/151.101.24.209] 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.
    Total time: 1 mins 46.894 secs

HI,

It looks like you have extra ** at the end of your testng compile

compile group: ‘org.testng’, name: ‘testng’, version: ‘6.8.8’**

can you remove it? can you run the following command from CMD gradlew test --info --stacktrace and add the output of the command to this thread in case it is still failing?

I have removed ** and tried, but no help. Also tried with v6.1.1.

Here is the command line output:
C:\Users\cheluvambika\workspace\samplegradle>gradlew test
:compileJava UP-TO-DATE
:processResources NO-SOURCE
:classes UP-TO-DATE
:compileTestJava FAILED

FAILURE: Build failed with an exception.

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

Could not resolve org.testng:testng:6.1.1.
Required by:
project :
Could not resolve org.testng:testng:6.1.1.
Could not get resource ‘http://repo.experitest.com:8010/Maven2/org/testn
g/testng/6.1.1/testng-6.1.1.pom’.
Could not GET ‘http://repo.experitest.com:8010/Maven2/org/testng/test
ng/6.1.1/testng-6.1.1.pom’.
Connect to repo.experitest.com:8010 [repo.experitest.com/207.232.4
0.121] failed: Connection timed out: connect
Could not resolve org.testng:testng:6.1.1.
Could not get resource ‘http://repo.maven.apache.org/maven2/org/testng/t
estng/6.1.1/testng-6.1.1.pom’.
Could not GET ‘http://repo.maven.apache.org/maven2/org/testng/testng/
6.1.1/testng-6.1.1.pom’.
Connect to repo.maven.apache.org:80 [repo.maven.apache.org/151.101
.40.215] failed: Connection timed out: connect
Could not resolve org.testng:testng:6.1.1.
Could not get resource ‘http://mvnrepository.com/maven2/org/testng/testn
g/6.1.1/testng-6.1.1.pom’.
Could not GET ‘http://mvnrepository.com/maven2/org/testng/testng/6.1.
1/testng-6.1.1.pom’.
Connect to mvnrepository.com:80 [mvnrepository.com/52.45.21.209, m
vnrepository.com/52.200.112.100] failed: Connection timed out: connect
Could not resolve org.testng:testng:6.1.1.
Could not get resource ‘https://repo1.maven.org/maven2/org/testng/testng
/6.1.1/testng-6.1.1.pom’.
Could not GET ‘https://repo1.maven.org/maven2/org/testng/testng/6.1.1
/testng-6.1.1.pom’.
Connect to repo1.maven.org:443 [repo1.maven.org/151.101.24.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 52.193 secs

C:\Users\cheluvambika\workspace\samplegradle>gradlew test
:compileJava FAILED

FAILURE: Build failed with an exception.

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

Could not resolve org.testng:testng:6.8.8.
Required by:
project :
Could not resolve org.testng:testng:6.8.8.
Could not get resource ‘http://repo.experitest.com:8010/Maven2/org/testn
g/testng/6.8.8/testng-6.8.8.pom’.
Could not GET ‘http://repo.experitest.com:8010/Maven2/org/testng/test
ng/6.8.8/testng-6.8.8.pom’.
Connect to repo.experitest.com:8010 [repo.experitest.com/207.232.4
0.121] failed: Connection timed out: connect
Could not resolve org.testng:testng:6.8.8.
Could not get resource ‘http://repo.maven.apache.org/maven2/org/testng/t
estng/6.8.8/testng-6.8.8.pom’.
Could not GET ‘http://repo.maven.apache.org/maven2/org/testng/testng/
6.8.8/testng-6.8.8.pom’.
Connect to repo.maven.apache.org:80 [repo.maven.apache.org/151.101
.24.215] failed: Connection timed out: connect
Could not resolve org.testng:testng:6.8.8.
Could not get resource ‘http://mvnrepository.com/maven2/org/testng/testn
g/6.8.8/testng-6.8.8.pom’.
Could not GET ‘http://mvnrepository.com/maven2/org/testng/testng/6.8.
8/testng-6.8.8.pom’.
Connect to mvnrepository.com:80 [mvnrepository.com/52.45.21.209, m
vnrepository.com/52.200.112.100] failed: Connection timed out: connect
Could not resolve org.testng:testng:6.8.8.
Could not get resource ‘https://repo1.maven.org/maven2/org/testng/testng
/6.8.8/testng-6.8.8.pom’.
Could not GET ‘https://repo1.maven.org/maven2/org/testng/testng/6.8.8
/testng-6.8.8.pom’.
Connect to repo1.maven.org:443 [repo1.maven.org/151.101.24.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 47.027 secs

Try using this configuration:
repositories {
mavenCentral()
maven { url “http://repo.experitest.com:8010/Maven2/” }
maven { url “http://repo.maven.apache.org/maven2” }
maven { url ‘http://mvnrepository.com/maven2’ }
}

dependencies {
compile group: ‘com.experitest’, name: ‘seetest-appium-repo’, version:‘10.8’
compile group: ‘org.testng’, name: ‘testng’, version: ‘6.8.8’
}

If you still stuck please follow the IDE advice and run it with ‘–stacktrace’

Thanks I am able to build now.