camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-11239: camel-catalog-maven - Remove sl4j logger as it causes tooling classloading pain
Date Mon, 08 May 2017 16:17:35 GMT
CAMEL-11239: camel-catalog-maven - Remove sl4j logger as it causes tooling classloading pain


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

Branch: refs/heads/camel-2.19.x
Commit: a713e3e65a16046ca573f13181e4ae95e18f8946
Parents: 118b37e
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon May 8 18:09:33 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon May 8 18:17:27 2017 +0200

----------------------------------------------------------------------
 platforms/camel-catalog-maven/pom.xml           |  5 ---
 .../catalog/maven/ComponentArtifactHelper.java  | 25 +++++------
 .../catalog/maven/ConnectorArtifactHelper.java  | 19 ++++-----
 .../maven/DefaultMavenArtifactProvider.java     | 45 ++++++++++++++------
 .../catalog/maven/MavenVersionManager.java      | 26 +++++++----
 .../catalog/nexus/BaseNexusRepository.java      | 29 ++++++++-----
 .../nexus/ComponentCatalogNexusRepository.java  | 14 +++---
 .../nexus/ConnectorCatalogNexusRepository.java  | 14 +++---
 8 files changed, 103 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a713e3e6/platforms/camel-catalog-maven/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/camel-catalog-maven/pom.xml b/platforms/camel-catalog-maven/pom.xml
index fd2ae4f..9237761 100644
--- a/platforms/camel-catalog-maven/pom.xml
+++ b/platforms/camel-catalog-maven/pom.xml
@@ -46,11 +46,6 @@
       <artifactId>camel-catalog-connector</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-    </dependency>
-
     <!-- use groovy grape to download JARs as that is easy to use -->
     <dependency>
       <groupId>org.codehaus.groovy</groupId>

http://git-wip-us.apache.org/repos/asf/camel/blob/a713e3e6/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/ComponentArtifactHelper.java
----------------------------------------------------------------------
diff --git a/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/ComponentArtifactHelper.java
b/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/ComponentArtifactHelper.java
index 234ee69..5fae4cf 100644
--- a/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/ComponentArtifactHelper.java
+++ b/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/ComponentArtifactHelper.java
@@ -19,9 +19,6 @@ package org.apache.camel.catalog.maven;
 import java.io.InputStream;
 import java.util.Properties;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import static org.apache.camel.catalog.CatalogHelper.loadText;
 
 /**
@@ -29,12 +26,10 @@ import static org.apache.camel.catalog.CatalogHelper.loadText;
  */
 public final class ComponentArtifactHelper {
 
-    private static final Logger LOG = LoggerFactory.getLogger(ComponentArtifactHelper.class);
-
     private ComponentArtifactHelper() {
     }
 
-    public static Properties loadComponentProperties(ClassLoader classLoader) {
+    public static Properties loadComponentProperties(boolean log, ClassLoader classLoader)
{
         Properties answer = new Properties();
         try {
             // load the component files using the recommended way by a component.properties
file
@@ -43,12 +38,14 @@ public final class ComponentArtifactHelper {
                 answer.load(is);
             }
         } catch (Throwable e) {
-            LOG.warn("Error loading META-INF/services/org/apache/camel/component.properties
file", e);
+            if (log) {
+                System.out.println("WARN: Error loading META-INF/services/org/apache/camel/component.properties
file due " + e.getMessage());
+            }
         }
         return answer;
     }
 
-    public static String extractComponentJavaType(ClassLoader classLoader, String scheme)
{
+    public static String extractComponentJavaType(boolean log, ClassLoader classLoader, String
scheme) {
         try {
             InputStream is = classLoader.getResourceAsStream("META-INF/services/org/apache/camel/component/"
+ scheme);
             if (is != null) {
@@ -57,17 +54,19 @@ public final class ComponentArtifactHelper {
                 return (String) props.get("class");
             }
         } catch (Throwable e) {
-            LOG.warn("Error loading META-INF/services/org/apache/camel/component/" + scheme
+ " file", e);
+            if (log) {
+                System.out.println("WARN: Error loading META-INF/services/org/apache/camel/component/"
+ scheme + " file due " + e.getMessage());
+            }
         }
 
         return null;
     }
 
-    public static String loadComponentJSonSchema(ClassLoader classLoader, String scheme)
{
+    public static String loadComponentJSonSchema(boolean log, ClassLoader classLoader, String
scheme) {
         String answer = null;
 
         String path = null;
-        String javaType = extractComponentJavaType(classLoader, scheme);
+        String javaType = extractComponentJavaType(log, classLoader, scheme);
         if (javaType != null) {
             int pos = javaType.lastIndexOf(".");
             path = javaType.substring(0, pos);
@@ -82,7 +81,9 @@ public final class ComponentArtifactHelper {
                     answer = loadText(is);
                 }
             } catch (Throwable e) {
-                LOG.warn("Error loading " + path + " file", e);
+                if (log) {
+                    System.out.println("WARN: Error loading " + path + " file due " + e.getMessage());
+                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/a713e3e6/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/ConnectorArtifactHelper.java
----------------------------------------------------------------------
diff --git a/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/ConnectorArtifactHelper.java
b/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/ConnectorArtifactHelper.java
index b233e95..d32d77d 100644
--- a/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/ConnectorArtifactHelper.java
+++ b/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/ConnectorArtifactHelper.java
@@ -18,33 +18,30 @@ package org.apache.camel.catalog.maven;
 
 import java.io.InputStream;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import static org.apache.camel.catalog.CatalogHelper.loadText;
 
 public final class ConnectorArtifactHelper {
 
-    private static final Logger LOG = LoggerFactory.getLogger(ComponentArtifactHelper.class);
-
     private ConnectorArtifactHelper() {
     }
 
-    public static String[] loadJSonSchemas(ClassLoader classLoader) {
+    public static String[] loadJSonSchemas(boolean log, ClassLoader classLoader) {
         String[] answer = new String[3];
-        answer[0] = loadJsonSchema(classLoader, "camel-connector.json");
-        answer[1] = loadJsonSchema(classLoader, "camel-connector-schema.json");
-        answer[2] = loadJsonSchema(classLoader, "camel-component-schema.json");
+        answer[0] = loadJsonSchema(log, classLoader, "camel-connector.json");
+        answer[1] = loadJsonSchema(log, classLoader, "camel-connector-schema.json");
+        answer[2] = loadJsonSchema(log, classLoader, "camel-component-schema.json");
         return answer;
     }
 
-    private static String loadJsonSchema(ClassLoader classLoader, String jsonSchemaPath)
{
+    private static String loadJsonSchema(boolean log, ClassLoader classLoader, String jsonSchemaPath)
{
         try (InputStream is = classLoader.getResourceAsStream(jsonSchemaPath)) {
             if (is != null) {
                 return loadText(is);
             }
         } catch (Throwable e) {
-            LOG.warn("Error loading " + jsonSchemaPath + " file", e);
+            if (log) {
+                System.out.println("WARN: Error loading " + jsonSchemaPath + " file due "
+ e.getMessage());
+            }
         }
         return null;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/a713e3e6/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/DefaultMavenArtifactProvider.java
----------------------------------------------------------------------
diff --git a/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/DefaultMavenArtifactProvider.java
b/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/DefaultMavenArtifactProvider.java
index 9361195..2cd95a1 100644
--- a/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/DefaultMavenArtifactProvider.java
+++ b/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/DefaultMavenArtifactProvider.java
@@ -30,8 +30,6 @@ import groovy.lang.GroovyClassLoader;
 import org.apache.camel.catalog.CamelCatalog;
 import org.apache.camel.catalog.CollectionStringBuffer;
 import org.apache.camel.catalog.connector.CamelConnectorCatalog;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import static org.apache.camel.catalog.maven.ComponentArtifactHelper.extractComponentJavaType;
 import static org.apache.camel.catalog.maven.ComponentArtifactHelper.loadComponentJSonSchema;
@@ -43,9 +41,16 @@ import static org.apache.camel.catalog.maven.ConnectorArtifactHelper.loadJSonSch
  */
 public class DefaultMavenArtifactProvider implements MavenArtifactProvider {
 
-    private static final Logger LOG = LoggerFactory.getLogger(DefaultMavenArtifactProvider.class);
-
     private String cacheDirectory;
+    private boolean log;
+
+    /**
+     * Sets whether to log errors and warnings to System.out.
+     * By default nothing is logged.
+     */
+    public void setLog(boolean log) {
+        this.log = log;
+    }
 
     @Override
     public void setCacheDirectory(String directory) {
@@ -67,7 +72,9 @@ public class DefaultMavenArtifactProvider implements MavenArtifactProvider
{
 
         try {
             if (cacheDirectory != null) {
-                LOG.debug("Using cache directory: {}", cacheDirectory);
+                if (log) {
+                    System.out.println("DEBUG: Using cache directory: " + cacheDirectory);
+                }
                 System.setProperty("grape.root", cacheDirectory);
             }
 
@@ -84,7 +91,9 @@ public class DefaultMavenArtifactProvider implements MavenArtifactProvider
{
                 param.put("validate", false);
                 param.put("transitive", false);
 
-                LOG.debug("Downloading {}:{}:{}", groupId, artifactId, version);
+                if (log) {
+                    System.out.println("Downloading " + groupId + ":" + artifactId + ":"
+ version);
+                }
                 Grape.grab(param);
 
                 // the classloader can load content from the downloaded JAR
@@ -97,7 +106,9 @@ public class DefaultMavenArtifactProvider implements MavenArtifactProvider
{
             }
 
         } catch (Exception e) {
-            LOG.warn("Error during add components from artifact " + groupId + ":" + artifactId
+ ":" + version + " due " + e.getMessage(), e);
+            if (log) {
+                System.out.println("WARN: Error during add components from artifact " + groupId
+ ":" + artifactId + ":" + version + " due " + e.getMessage());
+            }
         }
 
         return names;
@@ -105,7 +116,7 @@ public class DefaultMavenArtifactProvider implements MavenArtifactProvider
{
 
     protected void scanCamelComponents(CamelCatalog camelCatalog, ClassLoader classLoader,
Set<String> names) {
         // is there any custom Camel components in this library?
-        Properties properties = loadComponentProperties(classLoader);
+        Properties properties = loadComponentProperties(log, classLoader);
         if (properties != null) {
             String components = (String) properties.get("components");
             if (components != null) {
@@ -113,11 +124,13 @@ public class DefaultMavenArtifactProvider implements MavenArtifactProvider
{
                 for (String scheme : part) {
                     if (!camelCatalog.findComponentNames().contains(scheme)) {
                         // find the class name
-                        String javaType = extractComponentJavaType(classLoader, scheme);
+                        String javaType = extractComponentJavaType(log, classLoader, scheme);
                         if (javaType != null) {
-                            String json = loadComponentJSonSchema(classLoader, scheme);
+                            String json = loadComponentJSonSchema(log, classLoader, scheme);
                             if (json != null) {
-                                LOG.debug("Adding component: {}", scheme);
+                                if (log) {
+                                    System.out.println("Adding component: " + scheme);
+                                }
                                 camelCatalog.addComponent(scheme, javaType, json);
                                 names.add(scheme);
                             }
@@ -131,7 +144,7 @@ public class DefaultMavenArtifactProvider implements MavenArtifactProvider
{
     protected void scanCamelConnectors(CamelConnectorCatalog camelConnectorCatalog, ClassLoader
classLoader,
                                        String groupId, String artifactId, String version,
                                        Set<String> names) {
-        String[] json = loadJSonSchemas(classLoader);
+        String[] json = loadJSonSchemas(log, classLoader);
         if (json != null) {
             if (!camelConnectorCatalog.hasConnector(groupId, artifactId, version)) {
                 try {
@@ -149,13 +162,17 @@ public class DefaultMavenArtifactProvider implements MavenArtifactProvider
{
                         csb.append(text);
                     }
 
-                    LOG.debug("Adding connector: {} with scheme: {}", name, scheme);
+                    if (log) {
+                        System.out.println("Adding connector: " + name + " with scheme: "
+ scheme);
+                    }
                     camelConnectorCatalog.addConnector(groupId, artifactId, version,
                         name, scheme, javaType, description, csb.toString(), json[0], json[1],
json[2]);
 
                     names.add(name);
                 } catch (Throwable e) {
-                    LOG.warn("Error parsing Connector JSon due " + e.getMessage(), e);
+                    if (log) {
+                        System.out.println("WARN: Error parsing Connector JSon due " + e.getMessage());
+                    }
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/a713e3e6/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/MavenVersionManager.java
----------------------------------------------------------------------
diff --git a/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/MavenVersionManager.java
b/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/MavenVersionManager.java
index 0edfe72..066b7ca 100644
--- a/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/MavenVersionManager.java
+++ b/platforms/camel-catalog-maven/src/main/java/org/apache/camel/catalog/maven/MavenVersionManager.java
@@ -26,8 +26,6 @@ import java.util.Map;
 import groovy.grape.Grape;
 import groovy.lang.GroovyClassLoader;
 import org.apache.camel.catalog.VersionManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * A {@link VersionManager} that can load the resources using Maven to download needed artifacts
from
@@ -37,12 +35,11 @@ import org.slf4j.LoggerFactory;
  */
 public class MavenVersionManager implements VersionManager {
 
-    private static final Logger LOG = LoggerFactory.getLogger(MavenVersionManager.class);
-
     private final ClassLoader classLoader = new GroovyClassLoader();
     private String version;
     private String runtimeProviderVersion;
     private String cacheDirectory;
+    private boolean log;
 
     /**
      * Configures the directory for the download cache.
@@ -56,6 +53,14 @@ public class MavenVersionManager implements VersionManager {
     }
 
     /**
+     * Sets whether to log errors and warnings to System.out.
+     * By default nothing is logged.
+     */
+    public void setLog(boolean log) {
+        this.log = log;
+    }
+
+    /**
      * To add a 3rd party Maven repository.
      *
      * @param name the repository name
@@ -93,7 +98,9 @@ public class MavenVersionManager implements VersionManager {
             this.version = version;
             return true;
         } catch (Exception e) {
-            LOG.warn("Cannot load version " + version + " due " + e.getMessage());
+            if (log) {
+                System.out.print("WARN: Cannot load version " + version + " due " + e.getMessage());
+            }
             return false;
         }
     }
@@ -119,7 +126,9 @@ public class MavenVersionManager implements VersionManager {
             this.runtimeProviderVersion = version;
             return true;
         } catch (Exception e) {
-            LOG.warn("Cannot load runtime provider version " + version + " due " + e.getMessage());
+            if (log) {
+                System.out.print("WARN: Cannot load runtime provider version " + version
+ " due " + e.getMessage());
+            }
             return false;
         }
     }
@@ -157,8 +166,9 @@ public class MavenVersionManager implements VersionManager {
                 return found.openStream();
             }
         } catch (IOException e) {
-            // ignore
-            LOG.warn("Cannot open resource " + name + " and version " + version + " due "
+ e.getMessage());
+            if (log) {
+                System.out.print("WARN: Cannot open resource " + name + " and version " +
version + " due " + e.getMessage());
+            }
         }
 
         return null;

http://git-wip-us.apache.org/repos/asf/camel/blob/a713e3e6/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/BaseNexusRepository.java
----------------------------------------------------------------------
diff --git a/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/BaseNexusRepository.java
b/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/BaseNexusRepository.java
index 1962c09..d46b304 100644
--- a/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/BaseNexusRepository.java
+++ b/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/BaseNexusRepository.java
@@ -45,7 +45,8 @@ import org.slf4j.LoggerFactory;
  */
 public abstract class BaseNexusRepository {
 
-    final Logger log = LoggerFactory.getLogger(getClass());
+    final Logger logger = LoggerFactory.getLogger(getClass());
+    boolean log;
 
     private final Set<NexusArtifactDto> indexedArtifacts = new LinkedHashSet<>();
 
@@ -61,6 +62,14 @@ public abstract class BaseNexusRepository {
         this.classifier = classifier;
     }
 
+    /**
+     * Sets whether to log errors and warnings to System.out.
+     * By default nothing is logged.
+     */
+    public void setLog(boolean log) {
+        this.log = log;
+    }
+
     public String getNexusUrl() {
         return nexusUrl;
     }
@@ -111,32 +120,32 @@ public abstract class BaseNexusRepository {
      */
     public void start() {
         if (nexusUrl == null || nexusUrl.isEmpty()) {
-            log.warn("Nexus service not found. Indexing Nexus is not enabled!");
+            logger.warn("Nexus service not found. Indexing Nexus is not enabled!");
             return;
         }
 
         if (!started.compareAndSet(false, true)) {
-            log.info("NexusRepository is already started");
+            logger.info("NexusRepository is already started");
             return;
         }
 
-        log.info("Starting NexusRepository to scan every {} seconds", delay);
+        logger.info("Starting NexusRepository to scan every {} seconds", delay);
 
         executorService = Executors.newScheduledThreadPool(1);
 
         executorService.scheduleWithFixedDelay(() -> {
             try {
-                log.debug("Indexing Nexus {} +++ start +++", nexusUrl);
+                logger.debug("Indexing Nexus {} +++ start +++", nexusUrl);
                 indexNexus();
             } catch (Throwable e) {
                 if (e.getMessage().contains("UnknownHostException")) {
                     // less noise if its unknown host
-                    log.warn("Error indexing Nexus " + nexusUrl + " due unknown hosts: "
+ e.getMessage());
+                    logger.warn("Error indexing Nexus " + nexusUrl + " due unknown hosts:
" + e.getMessage());
                 } else {
-                    log.warn("Error indexing Nexus " + nexusUrl + " due " + e.getMessage(),
e);
+                    logger.warn("Error indexing Nexus " + nexusUrl + " due " + e.getMessage(),
e);
                 }
             } finally {
-                log.debug("Indexing Nexus {} +++ end +++", nexusUrl);
+                logger.debug("Indexing Nexus {} +++ end +++", nexusUrl);
             }
         }, initialDelay, delay, TimeUnit.SECONDS);
     }
@@ -145,7 +154,7 @@ public abstract class BaseNexusRepository {
      * Stops the Nexus indexer.
      */
     public void stop() {
-        log.info("Stopping NexusRepository");
+        logger.info("Stopping NexusRepository");
         if (executorService != null) {
             executorService.shutdownNow();
             executorService = null;
@@ -213,7 +222,7 @@ public abstract class BaseNexusRepository {
                     dto.setVersion(v);
                     dto.setArtifactLink(l);
 
-                    log.debug("Found: {}:{}:{}", dto.getGroupId(), dto.getArtifactId(), dto.getVersion());
+                    logger.debug("Found: {}:{}:{}", dto.getGroupId(), dto.getArtifactId(),
dto.getVersion());
 
                     // is it a new artifact
                     boolean newArtifact = true;

http://git-wip-us.apache.org/repos/asf/camel/blob/a713e3e6/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ComponentCatalogNexusRepository.java
----------------------------------------------------------------------
diff --git a/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ComponentCatalogNexusRepository.java
b/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ComponentCatalogNexusRepository.java
index 5d0d084..7270403 100644
--- a/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ComponentCatalogNexusRepository.java
+++ b/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ComponentCatalogNexusRepository.java
@@ -64,12 +64,12 @@ public class ComponentCatalogNexusRepository extends BaseNexusRepository
{
         // now download the new artifact JARs and look inside to find more details
         for (NexusArtifactDto dto : newArtifacts) {
             try {
-                log.debug("Processing new artifact: {}:{}:{}", dto.getGroupId(), dto.getArtifactId(),
dto.getVersion());
+                logger.debug("Processing new artifact: {}:{}:{}", dto.getGroupId(), dto.getArtifactId(),
dto.getVersion());
                 String url = createArtifactURL(dto);
                 URL jarUrl = new URL(url);
                 addCustomCamelComponentsFromArtifact(dto, jarUrl);
             } catch (Throwable e) {
-                log.warn("Error downloading component JAR " + dto.getArtifactLink() + ".
This exception is ignored. " + e.getMessage());
+                logger.warn("Error downloading component JAR " + dto.getArtifactLink() +
". This exception is ignored. " + e.getMessage());
             }
         }
     }
@@ -85,7 +85,7 @@ public class ComponentCatalogNexusRepository extends BaseNexusRepository
{
      */
     protected void addComponent(NexusArtifactDto dto, CamelCatalog camelCatalog, String scheme,
String javaType, String json) {
         camelCatalog.addComponent(scheme, javaType, json);
-        log.info("Added component: {}:{}:{} to Camel Catalog", dto.getGroupId(), dto.getArtifactId(),
dto.getVersion());
+        logger.info("Added component: {}:{}:{} to Camel Catalog", dto.getGroupId(), dto.getArtifactId(),
dto.getVersion());
     }
 
     /**
@@ -94,16 +94,16 @@ public class ComponentCatalogNexusRepository extends BaseNexusRepository
{
     private void addCustomCamelComponentsFromArtifact(NexusArtifactDto dto, URL jarUrl) {
         try (URLClassLoader classLoader = new URLClassLoader(new URL[]{jarUrl})) {
             // is there any custom Camel components in this library?
-            Properties properties = loadComponentProperties(classLoader);
+            Properties properties = loadComponentProperties(log, classLoader);
             String components = (String) properties.get("components");
             if (components != null) {
                 String[] part = components.split("\\s");
                 for (String scheme : part) {
                     if (!getCamelCatalog().findComponentNames().contains(scheme)) {
                         // find the class name
-                        String javaType = extractComponentJavaType(classLoader, scheme);
+                        String javaType = extractComponentJavaType(log, classLoader, scheme);
                         if (javaType != null) {
-                            String json = loadComponentJSonSchema(classLoader, scheme);
+                            String json = loadComponentJSonSchema(log, classLoader, scheme);
                             if (json != null) {
                                 addComponent(dto, getCamelCatalog(), scheme, javaType, json);
                             }
@@ -112,7 +112,7 @@ public class ComponentCatalogNexusRepository extends BaseNexusRepository
{
                 }
             }
         } catch (IOException e) {
-            log.warn("Error scanning JAR for custom Camel components", e);
+            logger.warn("Error scanning JAR for custom Camel components", e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/a713e3e6/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorCatalogNexusRepository.java
----------------------------------------------------------------------
diff --git a/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorCatalogNexusRepository.java
b/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorCatalogNexusRepository.java
index 39b1cd9..8c5633d 100644
--- a/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorCatalogNexusRepository.java
+++ b/platforms/camel-catalog-nexus/src/main/java/org/apache/camel/catalog/nexus/ConnectorCatalogNexusRepository.java
@@ -66,12 +66,12 @@ public class ConnectorCatalogNexusRepository extends BaseNexusRepository
{
         // now download the new artifact JARs and look inside to find more details
         for (NexusArtifactDto dto : newArtifacts) {
             try {
-                log.debug("Processing new artifact: {}:{}:{}", dto.getGroupId(), dto.getArtifactId(),
dto.getVersion());
+                logger.debug("Processing new artifact: {}:{}:{}", dto.getGroupId(), dto.getArtifactId(),
dto.getVersion());
                 String url = createArtifactURL(dto);
                 URL jarUrl = new URL(url);
                 addCustomCamelConnectorFromArtifact(dto, jarUrl);
             } catch (Throwable e) {
-                log.warn("Error downloading connector JAR " + dto.getArtifactLink() + ".
This exception is ignored. " + e.getMessage());
+                logger.warn("Error downloading connector JAR " + dto.getArtifactLink() +
". This exception is ignored. " + e.getMessage());
             }
         }
     }
@@ -97,7 +97,7 @@ public class ConnectorCatalogNexusRepository extends BaseNexusRepository
{
         String version = dto.getVersion();
 
         camelConnectorCatalog.addConnector(groupId, artifactId, version, name, scheme, javaType,
description, labels, connectorJson, connectorSchemaJson, componentSchemaJson);
-        log.info("Added connector: {}:{}:{}", dto.getGroupId(), dto.getArtifactId(), dto.getVersion());
+        logger.info("Added connector: {}:{}:{}", dto.getGroupId(), dto.getArtifactId(), dto.getVersion());
     }
 
     /**
@@ -125,7 +125,7 @@ public class ConnectorCatalogNexusRepository extends BaseNexusRepository
{
                 addConnector(dto, name, scheme, javaType, description, csb.toString(), json[0],
json[1], json[2]);
             }
         } catch (IOException e) {
-            log.warn("Error scanning JAR for custom Camel components", e);
+            logger.warn("Error scanning JAR for custom Camel components", e);
         }
     }
 
@@ -139,7 +139,7 @@ public class ConnectorCatalogNexusRepository extends BaseNexusRepository
{
                 answer[0] = loadText(is);
             }
         } catch (Throwable e) {
-            log.warn("Error loading " + path + " file", e);
+            logger.warn("Error loading " + path + " file", e);
         }
 
         path = "camel-connector-schema.json";
@@ -149,7 +149,7 @@ public class ConnectorCatalogNexusRepository extends BaseNexusRepository
{
                 answer[1] = loadText(is);
             }
         } catch (Throwable e) {
-            log.warn("Error loading " + path + " file", e);
+            logger.warn("Error loading " + path + " file", e);
         }
 
         path = "camel-component-schema.json";
@@ -159,7 +159,7 @@ public class ConnectorCatalogNexusRepository extends BaseNexusRepository
{
                 answer[2] = loadText(is);
             }
         } catch (Throwable e) {
-            log.warn("Error loading " + path + " file", e);
+            logger.warn("Error loading " + path + " file", e);
         }
 
         return answer;


Mime
View raw message