Unable to load the mojo 'test' - org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test
You can upgrade your maven version to 3.6.0 latest to solve this issue. This can be compatible from 3.3.9 maven version.
Looking at the comments on upgrading maven version, we updated our maven version and was able to overcome the surefire plugin issue using maven 3.3.9. Didn't get any issues.
I found that my NetBeans was using a very old maven (3.0.5) even though I had a brand new maven installed.
On my Mac, I had to go to the menu "Netbeans/Preferences", select the "Maven" tab, and change from "Bundled", browsed to latest, and this got rid of the error above for me.