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

maven-surefire-plugin version 2.20.1 giving NullPointerException #1513

Closed
aleenadavy90 opened this issue Mar 27, 2018 · 13 comments
Closed

maven-surefire-plugin version 2.20.1 giving NullPointerException #1513

aleenadavy90 opened this issue Mar 27, 2018 · 13 comments

Comments

@aleenadavy90
Copy link

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

@kcooney
Copy link
Member

kcooney commented Mar 27, 2018

@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.

@stefanbirkner
Copy link
Contributor

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).

@aleenadavy90
Copy link
Author

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

@aleenadavy90
Copy link
Author

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

@Tibor17
Copy link
Contributor

Tibor17 commented Mar 28, 2018 via email

@laki88
Copy link

laki88 commented Jun 17, 2018

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>

@Tibor17
Copy link
Contributor

Tibor17 commented Jun 17, 2018

@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.

@juanmiguel431
Copy link

Thansks @Tibor17 , @aleenadavy90

@silviuburceadev
Copy link

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

@Tibor17
Copy link
Contributor

Tibor17 commented Dec 27, 2018

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.

@loneshaana
Copy link

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

@Tibor17
Copy link
Contributor

Tibor17 commented Mar 18, 2019

@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.

@stambecg
Copy link

stambecg commented Jul 1, 2020

@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

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

No branches or pull requests

9 participants