maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schu...@apache.org
Subject [01/17] maven git commit: [MNG-5368] UnsupportedOperationException thrown when version range is not correct in dependencyManagement definitions [Forced Update!]
Date Tue, 31 Jan 2017 22:09:51 GMT
Repository: maven
Updated Branches:
  refs/heads/DEPMGMT-IT 04a9168f4 -> 75a0aeab0 (forced update)


[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/a3cdfbbb
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/a3cdfbbb
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/a3cdfbbb

Branch: refs/heads/DEPMGMT-IT
Commit: a3cdfbbbe9dcbd2737e3b4c1836c402f5d83ed46
Parents: 23b5fcf
Author: Christian Schulte <schulte@apache.org>
Authored: Sat Dec 19 17:37:11 2015 +0100
Committer: Christian Schulte <schulte@apache.org>
Committed: Tue Jan 31 22:44:59 2017 +0100

----------------------------------------------------------------------
 .../legacy/LegacyRepositorySystem.java          | 24 ++++++++++++++++----
 1 file changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/a3cdfbbb/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 f8d4531..bd5988a 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;
         }
 


Mime
View raw message