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

Fix Surefire missing NPE Issue #154

Conversation

ShawnLi-25
Copy link
Contributor

@ShawnLi-25 ShawnLi-25 commented Nov 24, 2020

#89

  • Handle NullPointerException error when surefire not explicitly declared in pom.xml
  • Use surefire fallback version 3.0.0-M5
  • Provide better error message

@@ -181,7 +181,9 @@ public void execute() throws MojoExecutionException, MojoFailureException {
this.surefire = this.lookupPlugin("org.apache.maven.plugins:maven-surefire-plugin");

if (this.surefire == null) {
Logger.getGlobal().log(Level.SEVERE, "Make sure surefire is in your pom.xml");
Logger.getGlobal().log(Level.SEVERE, "Surefire is not explicitly declared in your pom.xml;"
+ " we will use version 2.20, but you may want to change that.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surefire version seems to be updated to 2.22.2 instead of 2.20 as for NonDex itself.
Here I suppose the surefire version 2.20 is for the project NonDex intends to run upon. I am not sure whether 2.20 is the best choice.

It seems that a more recent surefire version (e.g., 3.0.0-M4) will be better, for both NonDex itself and the project under test, because it claims to provide better support for JUnit5. Please refer to https://maven.apache.org/surefire/maven-surefire-plugin/

Copy link
Contributor Author

@ShawnLi-25 ShawnLi-25 Dec 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we picked 2.20 becuase all sub-modules in integration tests use it.

Sure. I agree that upgrade Surefire for all modules or NonDex and even the running project to the most recent surefire version (e.g.3.0.0-M5) is better.

I just updated the fallback version in this PR and I'll do it for the other pom.xml in another.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your change:)

…ed in pom.xml & Use surefire fallback version 3.0.0-M5
@darko-marinov
Copy link
Contributor

Kaiyao confirmed via email that this functionality is included in the accepted big PR.

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 this pull request may close these issues.

3 participants