我正在尝试使用run.bat
文件在Jenkins中运行相同的程序。
它使我陷入错误:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.testng.xml.XMLParser (file:test ng path) to constructor com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl()
WARNING: Please consider reporting this to the maintainers of org.testng.xml.XMLParser
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.NoClassDefFoundError: bsh/EvalError
at org.testng.TestRunner.<init>(TestRunner.java:99)
at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:508)
at org.testng.SuiteRunner.init(SuiteRunner.java:142)
at org.testng.SuiteRunner.<init>(SuiteRunner.java:106)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1116)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1103)
at org.testng.TestNG.runSuitesLocally(TestNG.java:955)
at org.testng.TestNG.run(TestNG.java:900)
at org.testng.TestNG.privateMain(TestNG.java:1182)
at org.testng.TestNG.main(TestNG.java:1146)
Caused by: java.lang.ClassNotFoundException: bsh.EvalError
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 10 more
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
我的run.bat
文件具有
java -cp "lib/*;bin" org.testng.TestNG testng.xml
命令
我已在配置中将JAVA_HOME
设置为我的jdk