Opened 3 years ago

Closed 3 years ago

#10771 closed defect (fixed)

maven does not build with java 10

Reported by: Pierre Labastie Owned by: Pierre Labastie
Priority: normal Milestone: 8.3
Component: BOOK Version: SVN
Severity: normal Keywords:
Cc:

Description

The end of the log is:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Apache Maven 3.5.3 ................................. SUCCESS [ 26.231 s]
[INFO] Maven Model ........................................ FAILURE [  8.567 s]
[INFO] Maven Artifact ..................................... SKIPPED
[INFO] Maven Plugin API ................................... SKIPPED
[INFO] Maven Builder Support .............................. SKIPPED
[INFO] Maven Model Builder ................................ SKIPPED
[INFO] Maven Settings ..................................... SKIPPED
[INFO] Maven Settings Builder ............................. SKIPPED
[INFO] Maven Repository Metadata Model .................... SKIPPED
[INFO] Maven Artifact Resolver Provider ................... SKIPPED
[INFO] Maven Core ......................................... SKIPPED
[INFO] Maven SLF4J Simple Provider ........................ SKIPPED
[INFO] Maven Embedder ..................................... SKIPPED
[INFO] Maven Compat ....................................... SKIPPED
[INFO] Apache Maven Distribution 3.5.3 .................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.754 s
[INFO] Finished at: 2018-05-15T17:45:59+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project maven-model: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test failed.: NullPointerException -> [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/PluginExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :maven-model

Change History (3)

comment:1 by Pierre Labastie, 3 years ago

Owner: changed from blfs-book to Pierre Labastie
Status: newassigned
Type: enhancementdefect

comment:2 by Pierre Labastie, 3 years ago

Maven uses java version at some places, and the format of the java version has changed when moving to java 10... So it fails when running the tests (surefire returns a NullPointer exception when trying to access the version of the jdk). It can be corrected by moving to a more recent version of surefire, adding <version>2.21.0</version> at the right place in pom.xml.

sed '/-surefire-/a<version>2.21.0</version>' \
    -i pom.xml

This allows to fix the error, but the build fails later with:

[INFO] Reactor Summary:
[INFO] 
[INFO] Apache Maven 3.5.3 ................................. SUCCESS [  3.420 s]
[INFO] Maven Model ........................................ SUCCESS [  8.287 s]
[INFO] Maven Artifact ..................................... SUCCESS [  4.086 s]
[INFO] Maven Plugin API ................................... SUCCESS [  3.026 s]
[INFO] Maven Builder Support .............................. SUCCESS [  1.429 s]
[INFO] Maven Model Builder ................................ SUCCESS [  7.288 s]
[INFO] Maven Settings ..................................... SUCCESS [  0.701 s]
[INFO] Maven Settings Builder ............................. SUCCESS [  1.822 s]
[INFO] Maven Repository Metadata Model .................... SUCCESS [  0.502 s]
[INFO] Maven Artifact Resolver Provider ................... SUCCESS [  6.585 s]
[INFO] Maven Core ......................................... SUCCESS [ 25.330 s]
[INFO] Maven SLF4J Simple Provider ........................ SUCCESS [  4.737 s]
[INFO] Maven Embedder ..................................... FAILURE [  4.777 s]
[INFO] Maven Compat ....................................... SKIPPED
[INFO] Apache Maven Distribution 3.5.3 .................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:12 min
[INFO] Finished at: 2018-05-15T17:54:59+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project maven-embedder: There are test failures.
[ERROR] 
[ERROR] Please refer to /sources/maven/apache-maven-3.5.3/maven-embedder/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] -> [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 <goals> -rf :maven-embedder

It is again a problem with Java version, but now in another module. The following sed allows to build:

sed '/<commonsLang/s/3\.5/3.7/' \
    -i pom.xml

comment:3 by Pierre Labastie, 3 years ago

Resolution: fixed
Status: assignedclosed

Fixed at r20148

Note: See TracTickets for help on using tickets.