The aim is to clone my java project (which is using TestNG)from GitHub and execute the test from Jenkins using "Execute Windows batch command".
Step 1) I am cloning the project from GitHub using ssh
"git clone -b master https://github.com/xxxxxx/QACODE.git "
Step 2) Once clone is done there is a separate job for compiling and executing the project from TestNG file.
"cd C:\\Jenkins\\workspace\\Test_automation\\XXXProject"
"java -cp C:\\Jenkins\\workspace\\Test_automation\\XXXProject\\lib*;C:\\Jenkins\\workspace\\Test_automation\\XXXProject\\bin org.testng.TestNG TestNG.xml
Now I am getting the below error
[Test_automation] $ cmd /c call C:\\Users\\jenkins\\AppData\\Local\\Temp\\hudson1958039333746041382.bat [TestNG] [ERROR] Cannot instantiate class com.xxx.testcases.XxxTestCase Build step 'Execute Windows batch command' marked build as failure Finished: FAILURE
I can find all class\\java files in the cloned directory but still for some reason Jenkins not able to instantiate the class.
Thanks in advance!
这两个作业都指向不同的位置,一个是用户应用程序数据,另一个是jenkins主页工作空间,正如您提到的,两个单独的工作那里的工作空间将不同
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.