From 9c0f1209c4394fa5ca24173282b5f961601ab9de Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Tue, 11 Oct 2005 07:40:12 +0000 Subject: [PATCH] Re-enabling RELEASE resolution as a last-ditch, for backward compat...since I just re-enabled plugin LATEST metadata production. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@312828 13f79535-47bb-0310-9956-ffa450edef68 --- .../version/DefaultPluginVersionManager.java | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java b/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java index dcfc0a7521..d2d758eec7 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java @@ -168,26 +168,25 @@ public class DefaultPluginVersionManager } } - // TODO: Remove this...it shouldn't be needed anymore. - + // TODO: Remove this...it shouldn't be needed anymore. Leaving it in for backward compat. // final pass...retrieve the version for RELEASE and also set that resolved version as the // in settings.xml. -// if ( StringUtils.isEmpty( version ) ) -// { -// // 1. resolve the version to be used -// version = resolveMetaVersion( groupId, artifactId, project.getPluginArtifactRepositories(), localRepository, -// Artifact.RELEASE_VERSION ); -// -// if ( version != null ) -// { -// // 2. Set the updatedVersion so the user will be prompted whether to make this version permanent. -// updatedVersion = version; -// -// // 3. Persist this version without prompting. -// forcePersist = true; -// promptToPersist = false; -// } -// } + if ( StringUtils.isEmpty( version ) ) + { + // 1. resolve the version to be used + version = resolveMetaVersion( groupId, artifactId, project, localRepository, + Artifact.RELEASE_VERSION ); + + if ( version != null ) + { + // 2. Set the updatedVersion so the user will be prompted whether to make this version permanent. + updatedVersion = version; + + // 3. Persist this version without prompting. + forcePersist = true; + promptToPersist = false; + } + } // if we still haven't found a version, then fail early before we get into the update goop. if ( StringUtils.isEmpty( version ) )