diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index a33492812e..4672f12a79 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -182,7 +182,7 @@ public class DefaultPluginManager // TODO: this should be possibly outside // All version-resolution logic has been moved to DefaultPluginVersionManager. logger.debug( "Resolving plugin: " + plugin.getKey() + " with version: " + pluginVersion ); - if ( ( pluginVersion == null ) || Artifact.LATEST_VERSION.equals( pluginVersion ) || Artifact.RELEASE_VERSION.equals( pluginVersion ) ) + if ( pluginVersion == null ) { logger.debug( "Resolving version for plugin: " + plugin.getKey() ); pluginVersion = resolvePluginVersion( plugin.getGroupId(), plugin.getArtifactId(), project, session ); @@ -212,6 +212,8 @@ public class DefaultPluginManager { Artifact pluginArtifact = resolvePluginArtifact( plugin, project, session ); + plugin.setVersion( pluginArtifact.getBaseVersion() ); + addPlugin( plugin, pluginArtifact, project, session ); } else