Why not put the versions in this pom, because this pom is controlled by you, and anyone else who will ever use your project will be surprised that it does not work, because it missed the provision of properties on the command line. BTW: You checked the output via mvn -X -Dsurefire.version = 2.12, etc. I think you will get the same error message.
I recheck, and if you define the version this way, your project will be wrong if someone skips the options (-D ...) on the command line, you will get the following:
INFO] Scanning for projects... [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.soebes.katas:code:1.0-SNAPSHOT (/home/katas/pom.xml) has 1 error [ERROR] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin must be a valid version but is '${surefire.version}'. @ line 36, column 20 [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http:
In other words, it is a real bad idea to determine plugin versions (or dependencies on it) using options on the command line. I just recommend that you determine the version of everything you need in your pom and use the modulation and integration tests correctly through the surefire and / or fail-safe plugin. This will solve your problems.
source share