TestNg with Maven | Selenium Forum
M
Posted on 20/12/2016
I have mentioned testng.xml location in pom.xml inside src/test/resources folder and have also kept the testng.xml file in eclipse at the location mentioned in pom.xml file.

Then I ran the following commands :

mvn compile and mvn test but unable to run App Test and Sample Test java files. Getting the following error :

[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ TestNgMavenInteg
tion ---
[INFO] Surefire report directory: D:\workspace\LearnTestNg\TestNgMavenIntegrat
n\target\surefire-reports
Downloading: https://repo.maven.apache.org/maven2/org/testng/testng/5.7/testng
.7.pom
[INFO] -----------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] -----------------------------------------------------------------------
[INFO] Total time: 31.868 s
[INFO] Finished at: 2016-12-20T18:52:02+05:30
[INFO] Final Memory: 17M/174M
[INFO] -----------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:
12.4:test (default-test) on project TestNgMavenIntegration: Unable to generate
lasspath: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unab
to get dependency information for org.testng:testng:jar:jdk15:5.7: Failed to
trieve POM for org.testng:testng:jar:jdk15:5.7: Could not transfer artifact or
testng:testng:pom:5.7 from/to central (https://repo.maven.apache.org/maven2):
nnect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.40.215] fail
: Connection timed out: connect
[ERROR] org.testng:testng:jar:5.7
[ERROR]

Attaching the screenshot for error, pom.xml and testng.xml files

Please help

Thanks
Sankalp

M
Replied on 21/12/2016

Anyone please help?


M
Replied on 21/12/2016

are you using any proxy?


M
Replied on 22/12/2016

Yes


M
Replied on 22/12/2016

this problem occurs because of proxy is blocking the maven from contacting the maven server.

and maven cannot download jar files.


to solve this talk to network admin or stop using proxy all together.