maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [5/6] maven-indexer git commit: better logging
Date Mon, 24 Jul 2017 03:48:38 GMT
better logging

Signed-off-by: olivier lamy <olamy@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/maven-indexer/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-indexer/commit/ce2f8317
Tree: http://git-wip-us.apache.org/repos/asf/maven-indexer/tree/ce2f8317
Diff: http://git-wip-us.apache.org/repos/asf/maven-indexer/diff/ce2f8317

Branch: refs/heads/master
Commit: ce2f8317d234ed1a4a9c1f49d4d79506ce933eaf
Parents: a354f5c
Author: olivier lamy <olamy@apache.org>
Authored: Mon Jul 24 11:56:31 2017 +1000
Committer: olivier lamy <olamy@apache.org>
Committed: Mon Jul 24 11:56:31 2017 +1000

----------------------------------------------------------------------
 .../apache/maven/index/locator/ArtifactLocator.java   | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-indexer/blob/ce2f8317/indexer-core/src/main/java/org/apache/maven/index/locator/ArtifactLocator.java
----------------------------------------------------------------------
diff --git a/indexer-core/src/main/java/org/apache/maven/index/locator/ArtifactLocator.java
b/indexer-core/src/main/java/org/apache/maven/index/locator/ArtifactLocator.java
index f4feb34..d83b3a4 100644
--- a/indexer-core/src/main/java/org/apache/maven/index/locator/ArtifactLocator.java
+++ b/indexer-core/src/main/java/org/apache/maven/index/locator/ArtifactLocator.java
@@ -31,6 +31,8 @@ import org.apache.maven.index.artifact.GavCalculator;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Artifact locator.
@@ -40,6 +42,9 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 public class ArtifactLocator
     implements GavHelpedLocator
 {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger( ArtifactLocator.class );
+
     private final ArtifactPackagingMapper mapper;
 
     public ArtifactLocator( ArtifactPackagingMapper mapper )
@@ -83,14 +88,9 @@ public class ArtifactLocator
 
             return artifact;
         }
-        catch ( IOException e )
-        {
-            e.printStackTrace();
-            return null;
-        }
-        catch ( XmlPullParserException e )
+        catch ( XmlPullParserException | IOException e )
         {
-            e.printStackTrace();
+            LOGGER.warn( "skip error reading pom from file:" + source, e );
             return null;
         }
     }


Mime
View raw message