Version 2.12.4
of the maven-surefire-plugin is always added to the pom by maven version 3.x
unless you depend on a specific other version.
Maven has a so called super pom
that you get for free, but that doesn't list surefire: https://maven.apache.org/ref/3.8.5/maven-model-builder/super-pom.html
However it is added to the pom, i've checked this with maven 3.3.9. You can verify this by running mvn help:effective-pom
.
Reference with the same problem: No surefire plugin in my pom - How does it show surefire output?
These plugin versions are part of the default bindings for lifecycle executions, in this case of the test
phase. So these plugins are always included if not specified.
See for reference:
Normally this plugin should be available in maven central, check if you have a <pluginRepository>
in your (effective) pom that references https://repo1.maven.org/maven2/
Some other things you can check:
- Open the file
.m2\repository\org\apache\maven\plugins\maven-surefire-plugin\2.12.4\maven-surefire-plugin-2.12.4.jar.lastUpdated
and check the error message for each repository. Check why it can't reach maven central; is it missing from the list or giving an error? This might be a company firewall/policy issue perhaps? Or is it giving an error on HTTPS/TLS protocol level?
- Check if you can add maven central to your repositories list if it's missing somehow (should be included by default). Check if it's
HTTP
or HTTPS
, only secure is supported now.
- Run your maven command with
-X
for debug mode to investigate further
An alternative is to add the latest version of surefire to your project that is available in your plugin-repository, and perhaps disable it if you're not executing unit tests.
See Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.