Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mvn package causes NullPointerException in maven-surefire-plugin #43

Closed
janjagusch opened this issue Jun 4, 2020 · 0 comments · Fixed by #44
Closed

mvn package causes NullPointerException in maven-surefire-plugin #43

janjagusch opened this issue Jun 4, 2020 · 0 comments · Fixed by #44

Comments

@janjagusch
Copy link

janjagusch commented Jun 4, 2020

Hi, thanks for building gdv.xport!

Following #42, I run into an error when running mvn package from the source root.

mvn -version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.7, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.3.0-53-generic", arch: "amd64", family: "unix"
mvn package
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] GDV.XPort                                                          [pom]
[INFO] GDV.XPort-Lib                                                      [jar]
[INFO] GDV.XPort-Services                                                 [war]
[INFO] GDV.XPort-Deprecated                                               [jar]
[INFO] 
[INFO] --------------------< com.github.oboehm:gdv-xport >---------------------
[INFO] Building GDV.XPort 4.0.4                                           [1/4]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-versions) @ gdv-xport ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (default-prepare-agent) @ gdv-xport ---
[INFO] argLine set to -javaagent:/home/jan/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/home/jan/projects/personal/gdv.xport/target/jacoco.exec,append=true
[INFO] 
[INFO] ------------------< com.github.oboehm:gdv-xport-lib >-------------------
[INFO] Building GDV.XPort-Lib 4.0.4                                       [2/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-versions) @ gdv-xport-lib ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (default-prepare-agent) @ gdv-xport-lib ---
[INFO] argLine set to -javaagent:/home/jan/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/home/jan/projects/personal/gdv.xport/lib/target/jacoco.exec,append=true
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gdv-xport-lib ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 43 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ gdv-xport-lib ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ gdv-xport-lib ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 42 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ gdv-xport-lib ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.20.1:test (default-test) @ gdv-xport-lib ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for GDV.XPort 4.0.4:
[INFO] 
[INFO] GDV.XPort .......................................... SUCCESS [  0.994 s]
[INFO] GDV.XPort-Lib ...................................... FAILURE [  1.081 s]
[INFO] GDV.XPort-Services ................................. SKIPPED
[INFO] GDV.XPort-Deprecated ............................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.464 s
[INFO] Finished at: 2020-06-04T11:54:12+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project gdv-xport-lib: 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 :gdv-xport-lib

According to discussion here the recommended solution is to use the latest version of the maven surefire plugin (v3.0.0). I updated surefire locally and can confirm that this solved the issue for me.

However, I am not familiar with Java - maybe I am doing something wrong here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant