Can't execute goal org.eclipse.tycho:tycho-surefire-plugin:2.0.0:test (default-test) after switching to Java11

huangapple go评论87阅读模式
英文:

Can't execute goal org.eclipse.tycho:tycho-surefire-plugin:2.0.0:test (default-test) after switching to Java11

问题

我正在尝试将我们的遗留的基于 Eclipse 插件的多模块项目切换到 Java 11,并且已经做了几乎所有的工作,除了 "eclipse-test-plugin" 项目。所有这些项目都会抛出类似的错误:

  1. 警告:发生非法反射访问操作
  2. 警告:非法反射访问来自 org.eclipse.osgi.internal.baseadaptor.BaseStorage(文件:/home/USER/.m2/repository/p2/osgi/bundle/org.eclipse.osgi/3.9.1.v20140110-1610/org.eclipse.osgi-3.9.1.v20140110-1610.jar)到方法 java.net.URLClassLoader.addURL(java.net.URL)
  3. 警告:请考虑将此问题报告给 org.eclipse.osgi.internal.baseadaptor.BaseStorage 的维护人员
  4. 警告:使用 --illegal-access=warn 以启用进一步非法反射访问操作的警告
  5. 警告:所有非法访问操作将在未来版本中被拒绝
  6. 发生错误。请参阅日志文件
  7. /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/configuration/1599554461428.log
  8. [INFO] ------------------------------------------------------------------------
  9. [INFO] BUILD FAILURE
  10. [INFO] ------------------------------------------------------------------------
  11. [INFO] 总时间:26.877
  12. [INFO] 完成于:2020-09-08T04:41:01-04:00
  13. [INFO] ------------------------------------------------------------------------
  14. [ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:2.0.0:test (default-test) on project TEST-PROJECT: 在启动测试运行时时发生意外错误(进程返回错误代码 13)。用于启动子进程的命令行为 null -Dosgi.noShutdown=false -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86_64 --illegal-access=permit -Dosgi.clean=true -jar /home/USER/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.3.0.v20130327-1440/org.eclipse.equinox.launcher-1.3.0.v20130327-1440.jar -data /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/data -install /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work -configuration /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/configuration -application org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/surefire.properties 在工作目录 /home/USER/projects/java/PATH-TO-TEST-PROJECT -> [Help 1]

这是日志文件:

  1. !SESSION 2020-09-08 04:41:01.199 -----------------------------------------------
  2. eclipse.buildId=unknown
  3. java.version=11.0.7
  4. java.vendor=AdoptOpenJDK
  5. BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
  6. Framework arguments: -application org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/surefire.properties
  7. Command-line arguments: -data /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/data -application org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/surefire.properties
  8. !ENTRY org.eclipse.osgi 4 0 2020-09-08 04:41:01.829
  9. !MESSAGE Startup error
  10. !STACK 1
  11. java.lang.RuntimeException: Exception in org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start() of bundle org.eclipse.osgi.
  12. ...

MANIFEST.MF 文件如下:

  1. Manifest-Version: 1.0
  2. Bundle-ManifestVersion: 2
  3. Bundle-Name: PROJECT Test
  4. Bundle-SymbolicName: TEST-PROJECT
  5. Bundle-Version: 2.1.2
  6. Bundle-Vendor: VENDOR
  7. Fragment-Host: PROJECT-WHICH-IS-TESTED
  8. Bundle-RequiredExecutionEnvironment: JavaSE-11
  9. Import-Package: org.junit
  10. Require-Bundle: org.junit
  11. Automatic-Module-Name: TEST-PROJECT

这是父 POM 文件,其中包含 tycho-surefire-plugin:

  1. <pluginManagement>
  2. ...
  3. <plugins>
  4. <plugin>
  5. <groupId>org.eclipse.tycho</groupId>
  6. <artifactId>tycho-surefire-plugin</artifactId>
  7. <version>${tycho.version}</version>
  8. <configuration>
  9. <aggregate>true</aggregate>
  10. <argLine>
  11. --illegal-access=permit
  12. </argLine>
  13. </configuration>
  14. </plugin>
  15. </plugins>
  16. </pluginManagement>

这是 TEST-PROJECT 的 POM 文件:

  1. ...
  2. <build>
  3. <plugins>
  4. <plugin>
  5. <groupId>org.eclipse.tycho</groupId>
  6. <artifactId>tycho-surefire-plugin</artifactId>
  7. <configuration>
  8. <testSuite>${project.artifactId}</testSuite>
  9. <testClass>${project.artifactId}.suite.TestSuite</testClass>
  10. </configuration>
  11. </plugin>
  12. </plugins>
  13. </build>
  14. ...

如果运行 mvn clean install -X -e,我会得到以下错误:

  1. !ENTRY org.eclipse.osgi 4 0 2020-09-08 03:11:41.320
  2. !MESSAGE Startup error
  3. !STACK 1
  4. java.lang.RuntimeException: Exception in org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start() of bundle org.eclipse.osgi.
  5. ...

所以,有人可以给一些建议吗?附注:之前在 Java 8 下成功运行,并且使用 tycho-surefire 0.18.1 和 Bundle-RequiredExecutionEnvironment: JavaSE-1.7。

英文:

I'm trying to switch our legacy eclipse-plugin-based multi-modules project to Java-11, and made almost everything, except the "eclipse-test-plugin" projects. All of them throw a similar error

  1. WARNING: An illegal reflective access operation has occurred
  2. WARNING: Illegal reflective access by org.eclipse.osgi.internal.baseadaptor.BaseStorage (file:/home/USER/.m2/repository/p2/osgi/bundle/org.eclipse.osgi/3.9.1.v20140110-1610/org.eclipse.osgi-3.9.1.v20140110-1610.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
  3. WARNING: Please consider reporting this to the maintainers of org.eclipse.osgi.internal.baseadaptor.BaseStorage
  4. WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
  5. WARNING: All illegal access operations will be denied in a future release
  6. An error has occurred. See the log file
  7. /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/configuration/1599554461428.log.
  8. [INFO] ------------------------------------------------------------------------
  9. [INFO] BUILD FAILURE
  10. [INFO] ------------------------------------------------------------------------
  11. [INFO] Total time: 26.877 s
  12. [INFO] Finished at: 2020-09-08T04:41:01-04:00
  13. [INFO] ------------------------------------------------------------------------
  14. [ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:2.0.0:test (default-test) on project TEST-PROJECT: An unexpected error occurred while launching the test runtime (process returned error code 13). Command-line used to launch the sub-process was null -Dosgi.noShutdown=false -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86_64 --illegal-access=permit -Dosgi.clean=true -jar /home/USER/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.3.0.v20130327-1440/org.eclipse.equinox.launcher-1.3.0.v20130327-1440.jar -data /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/data -install /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work -configuration /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/configuration -application org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/surefire.properties in working directory /home/USER/projects/java/PATH-TO-TEST-PROJECT -&gt; [Help 1]

Here is the log file

  1. !SESSION 2020-09-08 04:41:01.199 -----------------------------------------------
  2. eclipse.buildId=unknown
  3. java.version=11.0.7
  4. java.vendor=AdoptOpenJDK
  5. BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
  6. Framework arguments: -application org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/surefire.properties
  7. Command-line arguments: -data /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/data -application org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/surefire.properties
  8. !ENTRY org.eclipse.osgi 4 0 2020-09-08 04:41:01.829
  9. !MESSAGE Startup error
  10. !STACK 1
  11. java.lang.RuntimeException: Exception in org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start() of bundle org.eclipse.osgi.
  12. at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.resume(InternalSystemBundle.java:233)
  13. at org.eclipse.osgi.framework.internal.core.Framework.launch(Framework.java:656)
  14. at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:275)
  15. at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
  16. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  17. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  18. at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  19. at java.base/java.lang.reflect.Method.invoke(Method.java:566)
  20. at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
  21. at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
  22. at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
  23. at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
  24. Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start() of bundle org.eclipse.osgi.
  25. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
  26. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
  27. at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.resume(InternalSystemBundle.java:225)
  28. ... 11 more
  29. Caused by: java.lang.IllegalStateException: The System Bundle could not be resolved: Missing Constraint: Bundle-RequiredExecutionEnvironment: J2SE-1.5
  30. at org.eclipse.osgi.internal.baseadaptor.BaseStorage.checkSystemState(BaseStorage.java:827)
  31. at org.eclipse.osgi.internal.baseadaptor.BaseStorage.getStateManager(BaseStorage.java:800)
  32. at org.eclipse.osgi.baseadaptor.BaseAdaptor.getState(BaseAdaptor.java:387)
  33. at org.eclipse.osgi.internal.baseadaptor.BaseStorage.frameworkStart(BaseStorage.java:923)
  34. at org.eclipse.osgi.baseadaptor.BaseAdaptor.frameworkStart(BaseAdaptor.java:250)
  35. at org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start(SystemBundleActivator.java:60)
  36. at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
  37. at java.base/java.security.AccessController.doPrivileged(Native Method)
  38. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
  39. ... 13 more

MANIFEST.MF looks like

  1. Manifest-Version: 1.0
  2. Bundle-ManifestVersion: 2
  3. Bundle-Name: PROJECT Test
  4. Bundle-SymbolicName: TEST-PROJECT
  5. Bundle-Version: 2.1.2
  6. Bundle-Vendor: VENDOR
  7. Fragment-Host: PROJECT-WHICH-IS-TESTED
  8. Bundle-RequiredExecutionEnvironment: JavaSE-11
  9. Import-Package: org.junit
  10. Require-Bundle: org.junit
  11. Automatic-Module-Name: TEST-PROJECT

and here is the parent pom with tycho-surefire-plugin

  1. &lt;pluginManagement&gt;
  2. ...
  3. &lt;plugins&gt;
  4. &lt;plugin&gt;
  5. &lt;groupId&gt;org.eclipse.tycho&lt;/groupId&gt;
  6. &lt;artifactId&gt;tycho-surefire-plugin&lt;/artifactId&gt;
  7. &lt;version&gt;${tycho.version}&lt;/version&gt;
  8. &lt;configuration&gt;
  9. &lt;aggregate&gt;true&lt;/aggregate&gt;
  10. &lt;argLine&gt;
  11. --illegal-access=permit
  12. &lt;/argLine&gt;
  13. &lt;/configuration&gt;
  14. &lt;/plugin&gt;
  15. &lt;/plugins&gt;
  16. &lt;/pluginManagement&gt;

Here is the pom of the TEST-PROJECT

  1. ...
  2. &lt;build&gt;
  3. &lt;plugins&gt;
  4. &lt;plugin&gt;
  5. &lt;groupId&gt;org.eclipse.tycho&lt;/groupId&gt;
  6. &lt;artifactId&gt;tycho-surefire-plugin&lt;/artifactId&gt;
  7. &lt;configuration&gt;
  8. &lt;testSuite&gt;${project.artifactId}&lt;/testSuite&gt;
  9. &lt;testClass&gt;${project.artifactId}.suite.TestSuite&lt;/testClass&gt;
  10. &lt;/configuration&gt;
  11. &lt;/plugin&gt;
  12. &lt;/plugins&gt;
  13. &lt;/build&gt;
  14. ...

If run mvn clean install -X -e then I'll get

  1. !ENTRY org.eclipse.osgi 4 0 2020-09-08 03:11:41.320
  2. !MESSAGE Startup error
  3. !STACK 1
  4. java.lang.RuntimeException: Exception in org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start() of bundle org.eclipse.osgi.
  5. at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.resume(InternalSystemBundle.java:233)
  6. at org.eclipse.osgi.framework.internal.core.Framework.launch(Framework.java:656)
  7. at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:275)
  8. at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
  9. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  10. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  11. at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  12. at java.base/java.lang.reflect.Method.invoke(Method.java:566)
  13. at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
  14. at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
  15. at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
  16. at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
  17. Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start() of bundle org.eclipse.osgi.
  18. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
  19. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
  20. at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.resume(InternalSystemBundle.java:225)
  21. ... 11 more
  22. Caused by: java.lang.IllegalStateException: The System Bundle could not be resolved: Missing Constraint: Bundle-RequiredExecutionEnvironment: J2SE-1.5
  23. at org.eclipse.osgi.internal.baseadaptor.BaseStorage.checkSystemState(BaseStorage.java:827)
  24. at org.eclipse.osgi.internal.baseadaptor.BaseStorage.getStateManager(BaseStorage.java:800)
  25. at org.eclipse.osgi.baseadaptor.BaseAdaptor.getState(BaseAdaptor.java:387)
  26. at org.eclipse.osgi.internal.baseadaptor.BaseStorage.frameworkStart(BaseStorage.java:923)
  27. at org.eclipse.osgi.baseadaptor.BaseAdaptor.frameworkStart(BaseAdaptor.java:250)
  28. at org.eclipse.osgi.framework.internal.core.SystemBundleActivator.start(SystemBundleActivator.java:60)
  29. at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
  30. at java.base/java.security.AccessController.doPrivileged(Native Method)
  31. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
  32. ... 13 more
  33. An error has occurred. See the log file
  34. /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/configuration/1599549100674.log.
  35. [INFO] ------------------------------------------------------------------------
  36. [INFO] BUILD FAILURE
  37. [INFO] ------------------------------------------------------------------------
  38. [INFO] Total time: 49.043 s
  39. [INFO] Finished at: 2020-09-08T03:11:41-04:00
  40. [INFO] ------------------------------------------------------------------------
  41. [ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:1.7.0:test (default-test) on project com.navteq.phoenix.datatest.test: An unexpected error occurred while launching the test runtime (process returned error code 13). Command-line used to launch the sub-process was null -Dosgi.noShutdown=false -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86_64 --illegal-access=permit -Dosgi.clean=true -jar /home/USER/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.3.0.v20130327-1440/org.eclipse.equinox.launcher-1.3.0.v20130327-1440.jar -debug -consolelog -data /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/data -install /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work -configuration /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/configuration -application org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/surefire.properties in working directory /home/USER/projects/java/PATH-TO-TEST-PROJECT -&gt; [Help 1]
  42. org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:1.7.0:test (default-test) on project com.navteq.phoenix.datatest.test: An unexpected error occurred while launching the test runtime (process returned error code 13). Command-line used to launch the sub-process was null -Dosgi.noShutdown=false -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86_64 --illegal-access=permit -Dosgi.clean=true -jar /home/USER/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.3.0.v20130327-1440/org.eclipse.equinox.launcher-1.3.0.v20130327-1440.jar -debug -consolelog -data /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/data -install /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work -configuration /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/configuration -application org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/surefire.properties in working directory /home/USER/projects/java/PATH-TO-TEST-PROJECT
  43. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
  44. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
  45. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
  46. at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
  47. at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
  48. at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
  49. at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
  50. at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
  51. at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
  52. at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
  53. at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
  54. at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
  55. at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
  56. at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
  57. at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
  58. at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
  59. at java.lang.reflect.Method.invoke (Method.java:566)
  60. at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
  61. at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
  62. at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
  63. at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
  64. Caused by: org.apache.maven.plugin.MojoFailureException: An unexpected error occurred while launching the test runtime (process returned error code 13). Command-line used to launch the sub-process was null -Dosgi.noShutdown=false -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86_64 --illegal-access=permit -Dosgi.clean=true -jar /home/USER/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.3.0.v20130327-1440/org.eclipse.equinox.launcher-1.3.0.v20130327-1440.jar -debug -consolelog -data /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/data -install /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work -configuration /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/work/configuration -application org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties /home/USER/projects/java/PATH-TO-TEST-PROJECT/target/surefire.properties in working directory /home/USER/projects/java/PATH-TO-TEST-PROJECT
  65. at org.eclipse.tycho.surefire.TestMojo.runTest (TestMojo.java:1093)
  66. at org.eclipse.tycho.surefire.TestMojo.execute (TestMojo.java:712)
  67. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
  68. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
  69. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
  70. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
  71. at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
  72. at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
  73. at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
  74. at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
  75. at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
  76. at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
  77. at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
  78. at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
  79. at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
  80. at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
  81. at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
  82. at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
  83. at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
  84. at java.lang.reflect.Method.invoke (Method.java:566)
  85. at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
  86. at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
  87. at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
  88. at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
  89. [ERROR]
  90. [ERROR]
  91. [ERROR] For more information about the errors and possible solutions, please read the following articles:
  92. [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

So could someone give some advice on what should I do in this situation?

P.S. Earlier all run successfully on Java8 with tycho-surefire 0.18.1 and Bundle-RequiredExecutionEnvironment: JavaSE-1.7

答案1

得分: 0

我相信我已经找到了问题的主要根源。关键是在我的父级pom.xml中将“Eclipse Kepler”设置为存储库。这就是为什么当我使用JavaSE-1.8时,surefire插件按预期工作,但当我切换到JavaSE-11时,“Kepler”变成了过时的,结果,我得到了一个关于

  1. 缺少约束:Bundle-RequiredExecutionEnvironmentJ2SE-1.5

切换到最新的eclipse存储库后,所有测试都被成功编译并通过。

英文:

I believe that I've found the main root of my problem. The point is that in my parent pom.xml there was set an "Eclipse Kepler" as a repository. That's why when I used JavaSE-1.8, surefire plugin worked as expected, but when I switched to JavaSE-11, "Kepler" turned out to be obsolete and as a result, I get a strange error about

  1. Missing Constraint: Bundle-RequiredExecutionEnvironment: J2SE-1.5

After changing to the latest eclipse repository, all tests were compiled and passed successfully.

huangapple
  • 本文由 发表于 2020年9月8日 17:33:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/63791097.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定