Repository: maven Updated Branches: refs/heads/master 6aa015d11 -> f2a8a4580
[MNG-5368] UnsupportedOperationException thrown when version range is not correct in dependencyManagement definitions o Updated to log an error message for any caught 'InvalidVersionSpecificationException's. Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/f2a8a458 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/f2a8a458 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/f2a8a458 Branch: refs/heads/master Commit: f2a8a4580f417a59afe34e425df150740429a5ea Parents: 6aa015d Author: Christian Schulte <schu...@apache.org> Authored: Sat Dec 19 17:37:11 2015 +0100 Committer: Christian Schulte <schu...@apache.org> Committed: Sat Dec 19 17:44:32 2015 +0100 ---------------------------------------------------------------------- .../legacy/LegacyRepositorySystem.java | 24 ++++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven/blob/f2a8a458/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java ---------------------------------------------------------------------- diff --git a/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java b/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java index 866968b..ba34096 100644 --- a/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java +++ b/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java @@ -144,6 +144,9 @@ public class LegacyRepositorySystem } catch ( InvalidVersionSpecificationException e ) { + // MNG-5368: Log a message instead of returning 'null' silently. + this.logger.error( String.format( "Invalid version specification '%s' creating dependency artifact '%s'.", + d.getVersion(), d ), e ); return null; } @@ -180,6 +183,11 @@ public class LegacyRepositorySystem } catch ( InvalidVersionSpecificationException e ) { + // MNG-5368: Log a message instead of returning 'null' silently. + this.logger.error( String.format( + "Invalid version specification '%s' creating extension artifact '%s:%s:%s'.", + version, groupId, artifactId, version, e ) ); + return null; } @@ -193,18 +201,24 @@ public class LegacyRepositorySystem public Artifact createPluginArtifact( Plugin plugin ) { + String version = plugin.getVersion(); + if ( StringUtils.isEmpty( version ) ) + { + version = "RELEASE"; + } + VersionRange versionRange; try { - String version = plugin.getVersion(); - if ( StringUtils.isEmpty( version ) ) - { - version = "RELEASE"; - } versionRange = VersionRange.createFromVersionSpec( version ); } catch ( InvalidVersionSpecificationException e ) { + // MNG-5368: Log a message instead of returning 'null' silently. + this.logger.error( String.format( + "Invalid version specification '%s' creating plugin artifact '%s'.", + version, plugin, e ) ); + return null; }