When doing a mvn test on a Java project on Win10 I get 2 failure notes:
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[ERROR] SeekTools: Seek for the Project Tool Folder (give option '-h' for help)
[ERROR] ERROR: reached root of filesystem
... test runs smoothly, but Surefire reports:
[INFO] Results:
[INFO]
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[ERROR] There are test failures.
I am using Maven 3.6.3 and Java 11.0.10 on Win10.
When doing the same to the same project on Debian-10, I get no such errors. Here I am using Maven 3.6.0 and Java 11.0.9.
I doubt that the small version difference causes the failures. But I got no clue how to start to solve them. Google did not help.
I am applying the plugins
maven-compiler-plugin 3.8.1
maven-surefire-plugin 3.0.0-M5
Do you got any hint for me how to approach this problem?
The complete output is here.
The pom.xml is here
#ngong
<forkCount>0</forkCount> and <forkMode>never</forkMode> is not a fix.
You are using JDK11. I guess you do not use JPMS.
We have a bug in Surefire and you can workaround it by <useModulePath>false</useModulePath>.
Setting forkCount to zero or forkMode to never is inherently wrong idea in this case because any changes in the environment may affect your tests on any machine.
Please see https://stackoverflow.com/a/65806777/2758738
Related
I am executing some selenium tests and wanted to add Shutterbug to my project for screenshots. I Added a mvn dependency:
<dependency>
<groupId>com.assertthat</groupId>
<artifactId>selenium-shutterbug</artifactId>
<version>1.3</version>
</dependency>
and started to code. It works as expected local, but when I wanted to run it on Jenkins, it gave me NoClassDefFound exception:
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] SomeTest.test:38 ยป NoClassDefFound com/assertthat/selenium_shutterbug/util...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
I have deleted all the code related to this library and just have now only the dependency in pom.xml. It fails even now. I found out that failure occures when I run it on Jenkins or when I run it local but in headless mode. How can I get it work?
I know there is a similar question to this (to question: Neo4j Spatial: can't run spatial), however that question seems to be solved when installing dependencies. I think that is not the solution to my case.
After installing Neo4j and installing maven
$ brew install neo4j
$ brew install maven
making a directory called spatial and cloning neo4j-spatial to this folder.
$ git clone https://github.com/neo4j-contrib/spatial.git
Then i tried to maven install this git clone.
/spatial$ mvn install
After a lot of test it returns a "Build failure"
Results :
Failed tests:
ProgressLoggingListenerTest.testProgressLoggingListnerWithAllLogs:38->testProgressLoggingListenerWithSpecifiedWaits:62
Argument(s) are different! Wanted:
forwardingPrintStream.println(
"100.00 (10/10) - Completed test"
);
-> at org.neo4j.gis.spatial.ProgressLoggingListenerTest.testProgressLoggingListenerWithSpecifiedWaits(ProgressLoggingListenerTest.java:62)
Actual invocation has different arguments:
forwardingPrintStream.println(
"10,00 (1/10) - Running test"
);
-> at org.neo4j.gis.spatial.rtree.ProgressLoggingListener.lambda$new$1(ProgressLoggingListener.java:45)
ProgressLoggingListenerTest.testProgressLoggingListnerWithOnlyStartAndEnd:46->testProgressLoggingListenerWithSpecifiedWaits:62
Argument(s) are different! Wanted:
forwardingPrintStream.println(
"100.00 (10/10) - Completed test"
);
-> at org.neo4j.gis.spatial.ProgressLoggingListenerTest.testProgressLoggingListenerWithSpecifiedWaits(ProgressLoggingListenerTest.java:62)
Actual invocation has different arguments:
forwardingPrintStream.println(
"10,00 (1/10) - Running test"
);
-> at org.neo4j.gis.spatial.rtree.ProgressLoggingListener.lambda$new$1(ProgressLoggingListener.java:45)
Tests run: 146, Failures: 2, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10:34 min
[INFO] Finished at: 2016-09-23T15:55:35+02:00
[INFO] Final Memory: 44M/558M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project neo4j-spatial: There are test failures.
[ERROR]
[ERROR] Please refer to /Volumes/Macintosh HD/Users/Tom/spatial/target/surefire-reports for the individual test results.
[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
In my queeste to solve this "Build failure" I discovered that most maven install errors are due to dependencies. However these error messages do not indicate any missing dependencies?
I tried using mvn verify however this just seems to try to build the plugin again returning the same Build failure.
/spatial$ mvn verify
Two questions;
- Am I missing dependencies or is the problem in something else?
- If I am missing dependencies, what are they and how to install them?
Thanks in advance!
The tests depend on the locale of the build environment as it checks the result of number formatting with decimal number, expecting a point as the decimal separator:
"100.00 (10/10) - Completed test"
Your locale uses the comma as the decimal separator, based on the actual value reported:
"10,00 (1/10) - Running test"
You have 2 options:
Build the project without running the tests:
mvn install -Dmaven.test.skip
Change the locale for the build:
LANG=C mvn install
or
LANG=en_US mvn install
I'm seeing something odd where I'm doing a Maven build that is implementing the swagger doclet for our API documentation (https://github.com/ryankennedy/swagger-jaxrs-doclet). When I do the build as reccommended there on the github page it builds fine locally on my Windows machine. The strangeness occurs when I try to do the exact same build on my Lunix vm and I get an error about unparsable POM files. A big difference I'm noticing is on the local machine there's a jar being pulled in that doesn't exist on the linux box: jaxrs-doclet-parent. This I'm assuming has something to do with the unparseable pom file error on the vm. Does anyone have an idea why a build would execute successfully on Windows (built via IntelliJ) but not on Linux?
Maven version is 3.0.3 on linux box and version is 3.2.1 on local windows machine
Here's the build error I am referring to:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.339s
[INFO] Finished at: Thu Jul 24 12:38:36 EDT 2014
[INFO] Final Memory: 32M/76M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:javadoc (generate-service-docs) on project scapi-ws: An error has occurred in JavaDocs report generation: Unable to build the Maven project for the artifact:groupId = 'com.hypnoticocelot'
[ERROR] artifactId = 'jaxrs-doclet'
[ERROR] version = '0.0.4-SNAPSHOT': 1 problem was encountered while building the effective model
[ERROR] [FATAL] Non-parseable POM /home/gwalker/.m2/repository/com/hypnoticocelot/jaxrs-doclet/0.0.4-SNAPSHOT/jaxrs-doclet-0.0.4-SNAPSHOT.pom: end tag name </body> must match start tag name <hr> from line 5 (position: TEXT seen ...</center>\r\n</body>... #6:8) # line 6, column 8
Turns out it was the maven version. On the linux box it was 3.0.3 and needed to be upgraded. Once I upgraded to 3.2.1 it built ok.
I have configured maven 3.2.2 and JBoss EAP 6.1 in centos 6.1;I have installed these things in a remote vm machine and accessing them using PuTTY
I have tried to run a quick start program helloworld-jms program using the command
`mvn clean compile exec:java`
it is giving the error saying
`[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:43 min
[INFO] Finished at: 2014-07-22T03:32:32+05:30
[INFO] Final Memory: 7M/171M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to parse plugin descriptor for org.codehaus.mojo:exec-maven-plugin:1.1.1 (/root/.m2/repository/org/codehaus/mojo/exec-maven-plugin/1.1.1/exec-maven-plugin-1.1.1.jar): error in opening zip file`
i thought problem is with the proxy settings and i went to /root/.m2/settings.xml and changed the proxy settings also still this problem is remaining
I have also removed the repository under .m2 folder and clean installed maven using the command
`mvn -U clean install`
it gave me a message build successful; and new repository appeared
again I tried to run the program with the command mvn clean compile exec:java
I couldn't locate the error
Please help me what could be the error and how to solve it; I have checked earlier posts and tried the best I could
I am upgrading my java 6 code to java 7. Have updated JAVA_HOME to point to JDK 1.7 on OS X 10.9. The code is not using any Java 7 features yet.
When I run the build "mvn clean install" the build breaks without any helpful error message.
The build succeeds with source=1.6 & target=1.6
But fails for source=1.7 (or 7) & target=1.7 (or 7)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version> <!-- tried with 2.3.2 and 3.0... no luck -->
<configuration>
<source>7</source>
<target>7</target>
<compilerArgument>-Werror </compilerArgument>
<fork>true</fork>
</configuration>
Error Message:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.773 s
[INFO] Finished at: 2014-06-25T14:56:13-08:00
[INFO] Final Memory: 10M/245M
[INFO] ------------------------------------------------------------------------
[**ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (default-testCompile) on project core: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] 1 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/MojoFailureException
I'm guessing that compiling your code with JDK 1.7 produces warnings that compiling with 1.6 did not. Since you're telling the compiler to simply quit when it encounters a warning with <compilerArgument>-Werror </compilerArgument>, that's exactly what it's doing, which isn't very Maven-friendly. I'm guessing Maven swallows the original warning in favor of showing the error of the javac process quitting unexpectedly.
Removing the <compilerArgument>-Werror </compilerArgument> directive should allow compilation to continue. You'll have to deal with the compiler warnings a better way than by just having the compiler quit, perhaps by looking at/parsing the Maven output.