我正在尝试从 GitHub 操作运行一个 Maven 项目,但它失败了,出现了很多我无法解决的错误。非常感谢任何帮助。
错误:
2023-03-02T19:55:03.1308028Z [INFO]
2023-03-02T19:55:03.1308665Z [INFO] -------------------------------------------------------
2023-03-02T19:55:03.1309334Z [INFO] T E S T S
2023-03-02T19:55:03.1309709Z [INFO] -------------------------------------------------------
2023-03-02T19:55:03.7212762Z [INFO]
2023-03-02T19:55:03.7213543Z [INFO] Results:
2023-03-02T19:55:03.7213970Z [INFO]
2023-03-02T19:55:03.7230143Z [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
2023-03-02T19:55:03.7230436Z [INFO]
2023-03-02T19:55:03.7285928Z [INFO] ------------------------------------------------------------------------
2023-03-02T19:55:03.7286503Z [INFO] BUILD FAILURE
2023-03-02T19:55:03.7287068Z [INFO] ------------------------------------------------------------------------
2023-03-02T19:55:03.7302478Z [INFO] Total time: 7.605 s
2023-03-02T19:55:03.7305208Z [INFO] Finished at: 2023-03-02T19:55:03Z
2023-03-02T19:55:03.7306231Z [INFO] ------------------------------------------------------------------------
2023-03-02T19:55:03.7315453Z [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test (default-test) on project denodoproject: There are test failures.
2023-03-02T19:55:03.7316101Z [ERROR]
2023-03-02T19:55:03.7317796Z [ERROR] Please refer to /home/runner/work/denodo_CI_CD/denodo_CI_CD/target/surefire-reports for the individual test results.
2023-03-02T19:55:03.7318580Z [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
2023-03-02T19:55:03.7319475Z [ERROR] There was an error in the forked process
2023-03-02T19:55:03.7320519Z [ERROR] Suite file /home/runner/work/denodo_CI_CD/denodo_CI_CD/testng.xml is not a valid file
2023-03-02T19:55:03.7321637Z [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
2023-03-02T19:55:03.7322487Z [ERROR] Suite file /home/runner/work/denodo_CI_CD/denodo_CI_CD/testng.xml is not a valid file
2023-03-02T19:55:03.7323596Z [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:657)
2023-03-02T19:55:03.7324553Z [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:283)
2023-03-02T19:55:03.7325514Z [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:246)
2023-03-02T19:55:03.7326565Z [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1161)
2023-03-02T19:55:03.7327529Z [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1002)
2023-03-02T19:55:03.7328448Z [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:848)
2023-03-02T19:55:03.7329281Z [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
2023-03-02T19:55:03.7330233Z [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:342)
2023-03-02T19:55:03.7331185Z [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:330)
2023-03-02T19:55:03.7333467Z [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
2023-03-02T19:55:03.7334284Z [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:175)
2023-03-02T19:55:03.7335259Z [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:76)
2023-03-02T19:55:03.7335819Z [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:163)
2023-03-02T19:55:03.7336637Z [ERROR] at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
2023-03-02T19:55:03.7337270Z [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:160)
2023-03-02T19:55:03.7337908Z [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
2023-03-02T19:55:03.7339932Z [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
2023-03-02T19:55:03.7340915Z [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
2023-03-02T19:55:03.7341820Z [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
2023-03-02T19:55:03.7342725Z [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:260)
2023-03-02T19:55:03.7344494Z [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:172)
2023-03-02T19:55:03.7344946Z [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:100)
2023-03-02T19:55:03.7348803Z [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:821)
2023-03-02T19:55:03.7350150Z [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:270)
2023-03-02T19:55:03.7351361Z [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
2023-03-02T19:55:03.7351775Z [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2023-03-02T19:55:03.7355639Z [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2023-03-02T19:55:03.7356926Z [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2023-03-02T19:55:03.7357418Z [ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
2023-03-02T19:55:03.7357904Z [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
2023-03-02T19:55:03.7358471Z [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
2023-03-02T19:55:03.7359040Z [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
2023-03-02T19:55:03.7359611Z [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
谁能帮我解决这个问题?我已经更改了插件版本和一切可能的东西。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<inherited>true</inherited>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
testng.xml
指向我要运行的类。提前致谢!
更新:能够通过添加 testng.xml 文件的完整路径来解决问题,但现在出现以下错误:
Cannot find class in classpath: denodoproject.test001GET
Error: org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
这是文件夹结构的屏幕截图,并添加了
testng.xml
文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Suite">
<test thread-count="5" name="Test">
<classes>
<class name="denodoproject.test001GET"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->