Maven "'version' is missing for plugin" in CI
Maven validation found a <plugin> with no <version>, and no pluginManagement, parent, or super-POM default supplies one. The build fails (or warns then fails on strict settings) before the plugin runs.
What this error means
mvn reports "'build.plugins.plugin.version' for org.apache.maven.plugins:maven-X-plugin is missing". It is deterministic until a version is pinned.
[ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-shade-plugin is missing.
@ line 54, column 15
[ERROR] The build could not read 1 project -> [Help 1]Common causes
A plugin configured without a version
The <plugin> omits <version> and there is no pluginManagement entry or parent default to fill it in.
A parent that used to manage the version was removed
Dropping a parent POM or pluginManagement block leaves the plugin version unset.
How to fix it
Pin the plugin version
- Add a
<version>to the plugin, or - Declare it once under
<pluginManagement>for the whole build. - Re-run
mvn validate.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
</plugin>Manage plugin versions centrally
Use pluginManagement in the parent so child modules inherit pinned versions.
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>How to prevent it
- Always pin plugin versions for reproducible builds.
- Manage plugin versions in the parent
pluginManagement. - Run
mvn validateafter POM edits.