Junit4: maven-surefire-plugin version 2.20.1 giving NullPointerException

Created on 27 Mar 2018  ·  13Comments  ·  Source: junit-team/junit4

My Appium-Java-Maven tests is giving the following error while running on Circle CI, runs fine locally
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project MumboiOSTests: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test failed.: NullPointerException

versions used:

maven: 3.5.3
maven-surefire-plugin:2.20.1
JUnit 4.11

Please find the log below
https://gist.github.com/aleenadavy90/bdc06f953397cd5240bf41eee1dee212

Most helpful comment

Try to use Surefire 2.21.0.

On Tue, Mar 27, 2018 at 11:39 PM, Aleena Davy notifications@github.com
wrote:

Closed #1513 https://github.com/junit-team/junit4/issues/1513.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit4/issues/1513#event-1544294784, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA_yRy5o3VjZZnpywEptCmm7Jc2co3Yjks5tirGkgaJpZM4S9j9B
.

--
Cheers
Tibor

All 13 comments

@aleenadavy90 The JUnit team doesn't maintain the JUnit Surefire integration. Does the full stacktrace show where the exception is happening? If it isn't in JUnit, then you want to file a bug with Surefire.

Can you please create an issue for the Surefire Plugin at https://issues.apache.org/jira/projects/SUREFIRE/issues

We are the developers of the JUnit 4 framework itself. We don't maintain the plugins of the different build tools (e.g. Ant, Gradle, Maven).

I see, thanks @stefanbirkner @kcooney. I'll do that.

looks like surefire plugin 2.20.1 is not compatible with java 10 yet, works fine with jdk 9.
Closing.

Try to use Surefire 2.21.0.

On Tue, Mar 27, 2018 at 11:39 PM, Aleena Davy notifications@github.com
wrote:

Closed #1513 https://github.com/junit-team/junit4/issues/1513.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/junit-team/junit4/issues/1513#event-1544294784, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA_yRy5o3VjZZnpywEptCmm7Jc2co3Yjks5tirGkgaJpZM4S9j9B
.

--
Cheers
Tibor

I couldn't build alone with 2.21.0. Anyway after adding asm latest dependency as below I could build the my project.

    <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.21.0</version>
      <dependencies>
        <dependency>
          <groupId>org.ow2.asm</groupId>
          <artifactId>asm</artifactId>
          <version>6.2</version> 
        </dependency>
      </dependencies>
    </plugin>

@aleenadavy90
@laki88
Check it out with Surefire 2.22.0. It already uses ASM 6.1.1 through plexus-java:0.9.8.
We had some problems with old ASM while developed JUnit5 and tested on JDK 10. Updated therefore.

Thansks @Tibor17 , @aleenadavy90

If anyone bumps into this, you need v2.22.1 for JDK 11.

Thx @silviu-burcea, the release notes lists also these bug fixes on ASF JIRA. We released 3.0.0-M3 few days ago which fully supports JDK 11. This version fixed maven-surefire-report-plugin with a sporadic issues on JDK 11. The problem was that old Doxia 1.6 used old version for the transitive dependency commons-lang. We updated Doxia 1.8 and the transitive dependencies with latest commons-lang. Surefire 3.0.0-M3 supports JDK 12 as our Jenkins build system runs on JDK 12 EA.

I couldn't build alone with 2.21.0. Anyway after adding asm latest dependency as below I could build the my project.

    <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.21.0</version>
      <dependencies>
        <dependency>
          <groupId>org.ow2.asm</groupId>
          <artifactId>asm</artifactId>
          <version>6.2</version> 
        </dependency>
      </dependencies>
    </plugin>

This one worked for me as well

@loneshaana
There is no reason to use such old version of Surefire 2.21.0. Use the latest version 3.0.0-M3 and you would not have problems.

@Tibor17 ,

Maven build is failing, could you please assit.

I have tried all the version of Maven-Surefire plugin from 2.18 to 3.0.0-M5

Please find the a attached console log and POM file for reference.

Logs.txt

pom.zip

Was this page helpful?
0 / 5 - 0 ratings