简体   繁体   中英

Maven surefire-plugin different version at execution than in pom

I am trying to move from JDK 8 --> JDK 11 and sure enough maven surefire-plugin is failing. So I know that I need to change it's version to 2.21.0 or above that and I already did so. The version is only referenced in one pom so everything should be fine and even intellIJ says that I am using version 2.22.2. The thing is I am when I run a mvn clean install -U or mvn test, or a mvn clean then mvn compile-test and lastly a test I am still getting error referencing: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project modular-index-composer: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test failed.: NullPointerException

How is it even possible? I am 100% sure that the project must have a version of 2.22.2. Is there any other way where it could be set?

Kinda obvious/dumb solution: So the project is made up of multiple modules, and there is a "parent" module that has most of the dependencies with their versions. I changed the sunfire version in this modules pom, and nothing seemed to be changing. (Eventhough intellij showed the correct newer version for the plugin)

So I decided to just exclude the parent pom and add the sunfire plugin with its version directly into my module. And behold it worked. The issue is probably something with the parent pom, my guess would be that my module is not pulling from the correct parent pom version or it mixed it up somehow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM