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