maven: Unable to run junit5-jupiter-starter-maven? - java

I downloaded the current version of the JUnit 5 sample code from https://github.com/junit-team/junit5-samples/tree/r5.2.0/ and extracted the subfolder junit5-jupiter-starter-maven to a local temp folder.
Then I openend a console window and tried to run that sample with mvnw clean test, but all I got was an java.lang.NoClassDefFoundError: org/junit/platform/launcher/core/LauncherFactory
Full maven output (of re-run without downloads):
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building junit5-vanilla-maven 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # junit5-vanilla-maven ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\temp\junit5-jupiter-starter-maven\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) # junit5-vanilla-maven ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # junit5-vanilla-maven ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\temp\junit5-jupiter-starter-maven\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) # junit5-vanilla-maven ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) # junit5-vanilla-maven ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.245 s
[INFO] Finished at: 2018-06-01T16:31:25+02:00
[INFO] Final Memory: 11M/306M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project junit5-vanilla-maven: There are test failures.
[ERROR]
[ERROR] Please refer to C:\temp\junit5-jupiter-starter-maven\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] java.lang.NoClassDefFoundError: org/junit/platform/launcher/core/LauncherFactory
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] java.lang.NoClassDefFoundError: org/junit/platform/launcher/core/LauncherFactory
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:658)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1149)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:978)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:854)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:39)
[ERROR] at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:122)
[ERROR] at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:50)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
mvnw --version:
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: C:\Users\<XXX>\.m2\wrapper\dists\apache-maven-3.5.0-bin\6ps54u5pnnbbpr6ds9rppcc7iv\apache-maven-3.5.0
Java version: 1.8.0_171, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_171\jre
Default locale: de_AT, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Did I do something wrong, or can you reproduce this problem?

Since the error is
[ERROR] java.lang.NoClassDefFoundError: org/junit/platform/launcher/core/LauncherFactory
I suggest to check the junit-platform-launcher jar file. Maybe it is corrupted.
It should be the one of\.m2\repository\org\junit\platform\junit-platform-launcher\1.2.0\junit-platform-launcher-1.2.0.jar

For my it was a different problem. Multimodule maven project has two modules A and B, where A is using junit-pioneer:1.9.1 (having transitive dependency from junit-platform-launcher:1.8.2) when module B doesn't use junit-pioneer but fails to build because of java.lang.NoClassDefFoundError: org/junit/platform/launcher/core/LauncherFactory when building the whole project with mvn clean install.
My solution was to add (unused) test dependency from junit-pioneer to module B.

Related

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.1.0:resources

Can any one help me? Why this is happen, and how to solve this error?
I try to run mvn clean package -DskipTests
[INFO]
[INFO] -------------------< com.hybris.hybris123:hybris123 >-------------------
[INFO] Building hybris123 1.1
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # hybris123 ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # hybris123 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.723 s
[INFO] Finished at: 2022-01-13T16:41:34+07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.1.0:resources (default-resources) on project hybris123: Cannot create resource output directory: /opt/CXCOMM210500P_0-70005661/hybris123/target/classes -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
My Java Home variable is /usr/lib/jvm/java-11-openjdk-amd64
And My maven variable like this :
export M2_HOME=/opt/maven
export MAVEN_HOME=/opt/maven
export PATH=${M2_HOME}/bin:${PATH}
Please Help me

Issue while running Jitsi videobridge

I tried to clone jvb and run with maven accordint to this. And i did it using docker. My dockerfile is
FROM ubuntu:18.04
RUN apt-get update -y
RUN apt-get install default-jdk -y
RUN apt-get install -y maven
CMD ["sleep","1000000"]
My docker-compose file is
version: '3.3'
services:
jvbz:
build: .
volumes:
- "./src:/jvb:rw"
- "./.m2:/root/.m2:rw"
working_dir: /jvb
ports:
- "8086:1999"
but when i run using maven it shows the following error:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] jvb-parent
[INFO] jvb-api-parent
[INFO] jvb-api-common
[INFO] jvb-api-client
[INFO] jitsi-videobridge
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jvb-parent 2.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) # jvb-parent ---
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:exec (default-cli) # jvb-parent ---
Error: Could not find or load main class org.jitsi.videobridge.MainKt
Caused by: java.lang.ClassNotFoundException: org.jitsi.videobridge.MainKt
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:982)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:929)
at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:457)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] jvb-parent ......................................... FAILURE [ 0.702 s]
[INFO] jvb-api-parent ..................................... SKIPPED
[INFO] jvb-api-common ..................................... SKIPPED
[INFO] jvb-api-client ..................................... SKIPPED
[INFO] jitsi-videobridge .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.118 s
[INFO] Finished at: 2021-03-31T14:55:55Z
[INFO] Final Memory: 11M/47M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project jvb-parent: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
You can view the source code here
Jitsi Videobridge is an XMPP server component that allows for multiuser video communication. Unlike the expensive dedicated hardware videobridges, Jitsi Videobridge does not mix the video channels into a composite video stream, but only relays the received video channels to all call participants. Therefore, while it does need to run on a server with good network bandwidth, CPU horsepower is not that critical for performance.
Can someone please help me with this.

Mvn clean package gives an unexpected java.lang.AssertionError

I am trying to do a mvn clean package to my Maven Springboot Project but I see the following message. What can be the reason? I already searched everything on the internet; it is a common situation but nobody has a definitive solution which can be useful for me.
My maven version is 3.6.3; I tried to do this from command line; my o.s. is Linux Mint Cinnamnon latest; my java is OpendJDK 11.0.5; maven compiler plugin 3.8.0.
[INFO] ------------------------------------------------------------------------
---------------------------------------------------
constituent[0]: file:/home/user/.sdkman/candidates/maven/current/conf/logging/
constituent[1]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-model-builder-3.6.3.jar
constituent[2]: file:/home/user/.sdkman/candidates/maven/current/lib/commons-io-2.5.jar
constituent[3]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-model-3.6.3.jar
constituent[4]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-settings-3.6.3.jar
constituent[5]: file:/home/user/.sdkman/candidates/maven/current/lib/jcl-over-slf4j-1.7.29.jar
constituent[6]: file:/home/user/.sdkman/candidates/maven/current/lib/cdi-api-1.0.jar
constituent[7]: file:/home/user/.sdkman/candidates/maven/current/lib/wagon-http-3.3.4-shaded.jar
constituent[8]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-embedder-3.6.3.jar
constituent[9]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-resolver-api-1.4.1.jar
constituent[10]: file:/home/user/.sdkman/candidates/maven/current/lib/wagon-provider-api-3.3.4.jar
constituent[11]: file:/home/user/.sdkman/candidates/maven/current/lib/plexus-interpolation-1.25.jar
constituent[12]: file:/home/user/.sdkman/candidates/maven/current/lib/guice-4.2.1-no_aop.jar
constituent[13]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-slf4j-provider-3.6.3.jar
constituent[14]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-resolver-connector-basic-1.4.1.jar
constituent[15]: file:/home/user/.sdkman/candidates/maven/current/lib/org.eclipse.sisu.plexus-0.3.4.jar
constituent[16]: file:/home/user/.sdkman/candidates/maven/current/lib/plexus-cipher-1.7.jar
constituent[17]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-shared-utils-3.2.1.jar
constituent[18]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-artifact-3.6.3.jar
constituent[19]: file:/home/user/.sdkman/candidates/maven/current/lib/plexus-sec-dispatcher-1.4.jar
constituent[20]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-resolver-impl-1.4.1.jar
constituent[21]: file:/home/user/.sdkman/candidates/maven/current/lib/org.eclipse.sisu.inject-0.3.4.jar
constituent[22]: file:/home/user/.sdkman/candidates/maven/current/lib/slf4j-api-1.7.29.jar
constituent[23]: file:/home/user/.sdkman/candidates/maven/current/lib/guava-25.1-android.jar
constituent[24]: file:/home/user/.sdkman/candidates/maven/current/lib/plexus-component-annotations-2.1.0.jar
constituent[25]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-core-3.6.3.jar
constituent[26]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-plugin-api-3.6.3.jar
constituent[27]: file:/home/user/.sdkman/candidates/maven/current/lib/jsr250-api-1.0.jar
constituent[28]: file:/home/user/.sdkman/candidates/maven/current/lib/plexus-utils-3.2.1.jar
constituent[29]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-repository-metadata-3.6.3.jar
constituent[30]: file:/home/user/.sdkman/candidates/maven/current/lib/jsoup-1.12.1.jar
constituent[31]: file:/home/user/.sdkman/candidates/maven/current/lib/commons-lang3-3.8.1.jar
constituent[32]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-compat-3.6.3.jar
constituent[33]: file:/home/user/.sdkman/candidates/maven/current/lib/commons-cli-1.4.jar
constituent[34]: file:/home/user/.sdkman/candidates/maven/current/lib/wagon-file-3.3.4.jar
constituent[35]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-resolver-transport-wagon-1.4.1.jar
constituent[36]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-settings-builder-3.6.3.jar
constituent[37]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-resolver-util-1.4.1.jar
constituent[38]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-resolver-spi-1.4.1.jar
constituent[39]: file:/home/user/.sdkman/candidates/maven/current/lib/javax.inject-1.jar
constituent[40]: file:/home/user/.sdkman/candidates/maven/current/lib/jansi-1.17.1.jar
constituent[41]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-builder-support-3.6.3.jar
constituent[42]: file:/home/user/.sdkman/candidates/maven/current/lib/maven-resolver-provider-3.6.3.jar
---------------------------------------------------
Exception in thread "main" java.lang.AssertionError
at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155)
at jdk.compiler/com.sun.tools.javac.util.Assert.check(Assert.java:46)
at jdk.compiler/com.sun.tools.javac.comp.Modules.enter(Modules.java:247)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.readSourceFile(JavaCompiler.java:837)
at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ImplicitCompleter.complete(JavacProcessingEnvironment.java:1529)
at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:642)
at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1326)
at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.complete(Type.java:1140)
at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.getTypeArguments(Type.java:1066)
at jdk.compiler/com.sun.tools.javac.code.Printer.visitClassType(Printer.java:237)
at jdk.compiler/com.sun.tools.javac.code.Printer.visitClassType(Printer.java:52)
at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.accept(Type.java:993)
at jdk.compiler/com.sun.tools.javac.code.Printer.visit(Printer.java:136)
at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument(AbstractDiagnosticFormatter.java:199)
at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArguments(AbstractDiagnosticFormatter.java:167)
at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:111)
at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:67)
at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument(AbstractDiagnosticFormatter.java:185)
at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArguments(AbstractDiagnosticFormatter.java:167)
at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:111)
at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:67)
at jdk.compiler/com.sun.tools.javac.util.JCDiagnostic.getMessage(JCDiagnostic.java:788)
at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$DiagnosticSourceUnwrapper.getMessage(ClientCodeWrapper.java:799)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:131)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:174)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1129)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:188)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
And this is the previous part of the output
user#User-VirtualBox-Mint:~/Desktop/mycompany/myapp$ mvn clean package -U -Dwithout-frontend
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] myapp [pom]
[INFO] myapp-server [jar]
[INFO]
[INFO] -----------------------< com.mycompany:myapp >------------------------
[INFO] Building myapp 1.0.0-SNAPSHOT [1/2]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # myapp ---
[INFO]
[INFO] --------------------< com.mycompany:myapp-server >--------------------
[INFO] Building myapp-server 1.0.0-SNAPSHOT [2/2]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # myapp-server ---
[INFO] Deleting /home/user/Desktop/mycompany/myapp/server/target
[INFO]
[INFO] --- git-commit-id-plugin:2.2.6:revision (default) # myapp-server ---
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.7.RELEASE:build-info (default) # myapp-server ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # myapp-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) # myapp-server ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 17 source files to /home/user/Desktop/mycompany/myapp/server/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for myapp 1.0.0-SNAPSHOT:
[INFO]
[INFO] myapp ............................................. SUCCESS [ 0.252 s]
[INFO] myapp-server ...................................... FAILURE [ 4.913 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.494 s
[INFO] Finished at: 2019-12-12T14:48:34+01:00
[INFO] ------------------------------------------------------------------------
---------------------------------------------------
If I try to add javaccompilerforce use in my main pom.xml such that this part is as following
<version>3.8.0</version>
<configuration>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
I see this time this new error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project myapp-server: Compilation failure: Compilation failure:
[ERROR] /home/user/Desktop/mycompany/myapp/server/src/main/java/com/mycompany/myapp/representation/rest/RestControllerAdvice.java:[8,38] error: package com.mycompany.myapp.exception does not exist
[ERROR] /home/user/Desktop/mycompany/myapp/server/src/main/java/com/mycompany/myapp/representation/rest/RestControllerAdvice.java:[25,84] error: cannot find symbol
[ERROR] symbol: class InvalidPropertyValueException
[ERROR] location: class RestControllerAdvice
[ERROR] /home/user/Desktop/mycompany/myapp/server/src/main/java/com/mycompany/myapp/representation/rest/RestControllerAdvice.java:[25,24] error: cannot find symbol
[ERROR] symbol: class InvalidPropertyValueException
[ERROR] location: class RestControllerAdvice
[ERROR] /home/user/Desktop/mycompany/myapp/server/src/main/java/com/mycompany/myapp/representation/rest/RestControllerAdvice.java:[24,20] error: cannot find symbol
[ERROR] symbol: class InvalidPropertyValueException
[ERROR] location: class RestControllerAdvice
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :myapp-server
Really, is the reason of the problem the absence of one folder or package? Or this second row is simply related to the javaccompilerforce option itself and not with the core of the app? It seems me too strange or banal. And, in add, the exactly same app works perfectly in another computer.
Edit
Thanks to all for your time, I think, the problem is the absence of some components. I tried to add those and now the error message is changed. At this point, I am a little bit in trouble because I see this maven output:
[ERROR] /home/user/Desktop/mycompany/myapp/server/src/main/java/com/mycompany/myapp/representation/rest/RestControllerAdvice.java:[8,38] error: cannot find symbol
[ERROR] symbol: class InvalidPropertyValueException
[ERROR] location: package com.mycompany.myapp.exception
So, I searched the 8 row in that file and I found this one
import org.springframework.web.bind.annotation.ExceptionHandler;
But, the line which is referred to InvalidPropertyValueException is 2 rows before:
import com.mycompany.myapp.exception.InvalidPropertyValueException;
And, the strange thing, in the package com.mycompanny.myapp.exception I didn't found any class or file named InvalidPropertyValueException. But Eclipse accept it and present me in the option list. And this class don't generate any error or red line.
you can try this command with skip your unit test cases
"mvn clean install -DskipTests=true"

JVM crashing when trying to run the tests by running `mvn test`

Note: I am now aware of The forked VM terminated without saying properly goodbye. VM crash or System.exit called, I tried many of the solutions expressed there and none of them work or make any difference. I documented in this question what I tried and what happened. I don't believe this is a duplicate of that question, essentially, because no answer is accepted so we can't know what the cause behind the error really was and many different problems could cause this same error (not all crashes are the same).
I'm sort of reviving a project that was left in a broken state when I try to run the tests I get this error:
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
I can't go back to a known working state, because, well, I don't know when that happened and under what conditions.
This is the full output from the command:
> mvn test
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.example:projectxserver >--------------------
[INFO] Building projectxserver 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The artifact org.hibernate:hibernate-validator:jar:6.0.17.Final has been relocated to org.hibernate.validator:hibernate-validator:jar:6.0.17.Final
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # projectxserver ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 15 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # projectxserver ---
[WARNING] ***********************************************************************************************************************************************************************
[WARNING] * Required filename-based automodules detected: [javax.servlet-api-4.0.1.jar, javax.inject-1.jar]. Please don't publish this project to a public artifact repository! *
[WARNING] ***********************************************************************************************************************************************************************
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) # projectxserver ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # projectxserver ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # projectxserver ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM 1. See FAQ web page and the dump file C:\Users\pupeno\Documents\projectx\code\projectxserver\target\surefire-reports\2019-09-26T05-51-30_012-jvmRun1.dumpstream
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.748 s
[INFO] Finished at: 2019-09-26T05:51:32+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project projectxserver: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\pupeno\Documents\projectx\code\projectxserver\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C "C:\Users\pupeno\scoop\apps\oraclejdk\current\bin\java #C:\Users\pupeno\AppData\Local\Temp\surefire12697495595942050464\surefireargs12476787747337053319 C:\Users\pupeno\AppData\Local\Temp\surefire12697495595942050464 2019-09-26T05-51-30_012-jvmRun1 surefire10872047683044717734tmp surefire_013239801033816370074tmp"
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C "C:\Users\pupeno\scoop\apps\oraclejdk\current\bin\java #C:\Users\pupeno\AppData\Local\Temp\surefire12697495595942050464\surefireargs12476787747337053319 C:\Users\pupeno\AppData\Local\Temp\surefire12697495595942050464 2019-09-26T05-51-30_012-jvmRun1 surefire10872047683044717734tmp surefire_013239801033816370074tmp"
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:567)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Not sure what information is relevant at this point, I'm happy to add whatever is needed to this question.
I tried OpenJDK 11, 12 and OracleJDK 12 as well as maven-sure-fire-plugin 2.22.2 and 3.0.0-M3. All give the same error.
I tried mvn clean and re-built. I tried removing my whole Maven repo, the .m2 directory.
I also tried adding <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine> as explained in The forked VM terminated without saying properly goodbye. VM crash or System.exit called as well as <argLine>-Xmx2048m -XX:MaxPermSize=1024m</argLine> just to make sure, but the error remained the same. I tried this only with Oracle JDK 12.
I also tried:
<configuration>
<forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<argLine>-Xmx2048m -XX:MaxPermSize=1024m</argLine>
</configuration>
just in case the other two parameters were relevant and it failed with this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project dashmanserver: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test failed: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.StartupReportConfiguration -> [Help 1]
I tried adding <testFailureIgnore>true</testFailureIgnore> but I get the same error.
Have the same issue; build works on one machine but on another machine it does not work.
Maven log on failing machine mentions a "dumpstream" file, e.g. \xxx\target\surefire-reports\2020-05-12T17-21-34_124.dumpstream
Peeking into that reveals:
# Created at 2020-05-12T17:21:35.135
Ursache: java.lang.ClassNotFoundException: LastName\/m2\repository\javax\servlet\javax/servlet-api\4/0/1\javax/servlet-api-4/0/1/jar;C:\Users\FirstName
So it turns out that I have "c:\users\FirstName LastName" as user directory, e.g. a space in my username, and I would assume that since servlet-api 4.0.1 does not have a module-info.class so there's some lookup in MANIFEST.MF I believe or whatever.
The other machine where the build is running fine is with a user directory that does not have a space in its name.
Weird thing is that it happens only when running tests, and it does not seem to matter whether useModulePath is true or false for maven-surefire-plugin

Why it throws JSP file does not exist exception

Why it still fails even after setting the WebContent as the Resource?
This solution doesn't help
[INFO] --- maven-war-plugin:2.2:war (default-war) # ESWebApp ---
[INFO] Packaging webapp
[INFO] Assembling webapp [ESWebApp] in
[/Users/alim/practice/ElasticSearchAutoComplete/webApp-api/target/webapp-api]
[INFO] Processing war project
[INFO] Copying webapp webResources
[/Users/alim/practice/ElasticSearchAutoComplete/webApp-api/WebContent\WEB-INF\pages] to
[/Users/alim/practice/ElasticSearchAutoComplete/webApp-api/target/webapp-api]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.863 s
[INFO] Finished at: 2018-11-25T21:17:49+08:00
[INFO] Final Memory: 25M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project ESWebApp: Could not copy resource
[/Users/alim/practice/ElasticSearchAutoComplete/webApp-api/WebContent\WEB-INF\pages]: File /Users/alim/practice/ElasticSearchAutoComplete/webApp-api/WebContent\WEB-INF\pages/autocomplete.jsp does not exist -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Please take a look.
Thanks in advance

Categories

Resources