Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvladt2011-02-10 16:45:07 -0500
committervladt2011-02-10 16:45:46 -0500
commita1639bf8aa6a6a8ba1575b1a4d183e6815128f6b (patch)
treea16427af1501cc6077652bc4c008f76257d89598
parentd778f2782d0a1dd50307452f30961bbecf1b1075 (diff)
downloadm2e-core-a1639bf8aa6a6a8ba1575b1a4d183e6815128f6b.tar.gz
m2e-core-a1639bf8aa6a6a8ba1575b1a4d183e6815128f6b.tar.xz
m2e-core-a1639bf8aa6a6a8ba1575b1a4d183e6815128f6b.zip
335872: Replaced MavenLogger with slf4j loggers
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenPlugin.java6
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogFactory.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogsWriter.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenLogger.java59
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java11
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ExtensionModule.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExternalRuntime.java11
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java24
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/WagonTransferListenerAdapter.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java29
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecycle/LifecycleMappingFactory.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java7
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java9
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java11
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob.java17
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistry.java15
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectInfo.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java7
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java15
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java24
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java2
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesActionDelegate.java7
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java3
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java7
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java9
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenJdtImages.java7
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java11
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenLaunchConfigurationListener.java9
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/filter/MavenModuleFilter.java7
-rw-r--r--org.eclipse.m2e.launching/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java12
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java18
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenFileEditorInput.java3
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java10
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java6
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java6
-rw-r--r--org.eclipse.m2e.refactoring/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java6
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/ChangeCreator.java7
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/RefactoringModelResources.java7
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringImages.java6
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactAction.java7
-rw-r--r--org.eclipse.m2e.scm/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java17
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/ScmHandlerFactory.java9
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java10
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandler.java6
51 files changed, 275 insertions, 254 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenPlugin.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenPlugin.java
index 1204dfdd..9b92fc0c 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenPlugin.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenPlugin.java
@@ -53,7 +53,6 @@ import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory;
import org.eclipse.m2e.core.archetype.ArchetypeManager;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.core.MavenConsole;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.embedder.MavenModelManager;
@@ -84,6 +83,7 @@ import org.eclipse.m2e.core.repository.IRepositoryRegistry;
* MavenPlugin main plug-in class.
*/
public class MavenPlugin extends Plugin {
+ private static final Logger log = LoggerFactory.getLogger(MavenPlugin.class);
// preferences
private static final String PREFS_ARCHETYPES = "archetypesInfo.xml"; //$NON-NLS-1$
@@ -161,8 +161,6 @@ public class MavenPlugin extends Plugin {
// ignored
}
- MavenLogger.setLog(getLog());
-
this.mavenConfiguration = new MavenConfigurationImpl();
ClassLoader cl = MavenPlugin.class.getClassLoader();
@@ -178,7 +176,7 @@ public class MavenPlugin extends Plugin {
this.archetypeManager.readCatalogs();
} catch(Exception ex) {
String msg = "Can't read archetype catalog configuration";
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
}
this.mavenMarkerManager = new MavenMarkerManager(mavenConfiguration);
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogFactory.java
index 8b9331bd..ca5a5100 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogFactory.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogFactory.java
@@ -13,6 +13,9 @@ package org.eclipse.m2e.core.archetype;
import java.util.Properties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -25,7 +28,6 @@ import org.apache.maven.archetype.source.ArchetypeDataSourceException;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.internal.Messages;
@@ -33,6 +35,8 @@ import org.eclipse.m2e.core.internal.Messages;
* Abstract ArchetypeCatalog factory
*/
public abstract class ArchetypeCatalogFactory {
+ private static final Logger log = LoggerFactory.getLogger(ArchetypeCatalogFactory.class);
+
private final String id;
private final String description;
@@ -83,7 +87,7 @@ public abstract class ArchetypeCatalogFactory {
return source.getArchetypeCatalog(new Properties());
} catch(ArchetypeDataSourceException ex) {
String msg = NLS.bind(Messages.ArchetypeCatalogFactory_error_missing_catalog, ex.getMessage());
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, ex));
}
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogsWriter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogsWriter.java
index aecc0a6d..2893e39d 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogsWriter.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogsWriter.java
@@ -27,6 +27,9 @@ import javax.xml.transform.TransformerFactoryConfigurationError;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
@@ -39,7 +42,6 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.LocalCatalogFactory;
import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.internal.Messages;
@@ -49,6 +51,7 @@ import org.eclipse.m2e.core.internal.Messages;
* @author Eugene Kuleshov
*/
public class ArchetypeCatalogsWriter {
+ private static final Logger log = LoggerFactory.getLogger(ArchetypeCatalogsWriter.class);
private static final String ELEMENT_CATALOGS = "archetypeCatalogs"; //$NON-NLS-1$
@@ -73,11 +76,11 @@ public class ArchetypeCatalogsWriter {
parser.parse(is, new ArchetypeCatalogsContentHandler(catalogs));
} catch(SAXException ex) {
String msg = Messages.ArchetypeCatalogsWriter_error_parse;
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
throw new IOException(NLS.bind(msg, ex.getMessage()));
} catch(ParserConfigurationException ex) {
String msg = Messages.ArchetypeCatalogsWriter_error_parse;
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
throw new IOException(NLS.bind(msg, ex.getMessage()));
}
return catalogs;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenLogger.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenLogger.java
deleted file mode 100644
index 2cef32db..00000000
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenLogger.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.m2e.core.core;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-
-/**
- * Maven Logger
- *
- * @author Eugene Kuleshov
- */
-public class MavenLogger {
-
- private static ILog LOG;
-
- public static void setLog(ILog log) {
- LOG = log;
- }
-
- public static void log(IStatus status) {
- LOG.log(status);
- }
-
- public static void log(CoreException ex) {
- IStatus s = ex.getStatus();
- if(s.getException() == null) {
- int n = s.getSeverity();
- log(new Status(n == IStatus.CANCEL || n == IStatus.ERROR || n == IStatus.INFO //
- || n == IStatus.WARNING || n == IStatus.OK ? n : IStatus.ERROR, //
- s.getPlugin() == null ? IMavenConstants.PLUGIN_ID : s.getPlugin(), //
- s.getCode(), //
- s.getMessage() == null ? s.toString() : s.getMessage(), //
- ex));
- } else {
- log(s);
- }
- }
-
- public static void log(String msg, Throwable t) {
- log(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, msg, t));
- }
-
- public static void log(String msg) {
- log(new Status(IStatus.OK, IMavenConstants.PLUGIN_ID, msg));
- }
-}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java
index 5bd5ef4a..0d288159 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java
@@ -30,6 +30,9 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -64,7 +67,6 @@ import org.sonatype.aether.util.graph.transformer.JavaEffectiveScopeCalculator;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.internal.Messages;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectManager;
@@ -87,6 +89,7 @@ import org.eclipse.m2e.model.edit.pom.util.PomResourceImpl;
* XXX fix circular dependency
*/
public class MavenModelManager {
+ private static final Logger log = LoggerFactory.getLogger(MavenModelManager.class);
static final PomFactory POM_FACTORY = PomFactory.eINSTANCE;
@@ -110,7 +113,7 @@ public class MavenModelManager {
} catch(Exception ex) {
String msg = NLS.bind(Messages.MavenModelManager_error_cannot_load, pomFile);
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, ex));
}
}
@@ -231,7 +234,7 @@ public class MavenModelManager {
node = MavenPlugin.getDefault().getRepositorySystem().collectDependencies(session, request).getRoot();
} catch(DependencyCollectionException ex) {
String msg = Messages.MavenModelManager_error_read;
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, ex));
}
@@ -308,7 +311,7 @@ public class MavenModelManager {
resource.save(Collections.EMPTY_MAP);
} catch(Exception ex) {
String msg = "Unable to update " + pom;
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
} finally {
if (resource != null) {
resource.unload();
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java
index c0c542e6..1ded51fc 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java
@@ -16,6 +16,8 @@ import java.util.ArrayList;
import java.util.List;
import org.osgi.framework.Bundle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -27,7 +29,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
@@ -37,6 +38,7 @@ import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
* @author Eugene Kuleshov
*/
public class ExtensionReader {
+ private static final Logger log = LoggerFactory.getLogger(ExtensionReader.class);
public static final String EXTENSION_ARCHETYPES = IMavenConstants.PLUGIN_ID + ".archetypeCatalogs"; //$NON-NLS-1$
@@ -91,7 +93,7 @@ public class ExtensionReader {
description, false);
}
}
- MavenLogger.log("Unable to find Archetype catalog " + name + " in " + contributor.getName(), null);
+ log.error("Unable to find Archetype catalog " + name + " in " + contributor.getName());
}
} else if(ELEMENT_REMOTE_ARCHETYPE.equals(element.getName())) {
String url = element.getAttribute(ATTR_URL);
@@ -117,7 +119,7 @@ public class ExtensionReader {
try {
listeners.add( (IMavenProjectChangedListener) element.createExecutableExtension("class") ); //$NON-NLS-1$
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
}
@@ -126,5 +128,4 @@ public class ExtensionReader {
return listeners;
}
-
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ExtensionModule.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ExtensionModule.java
index ddf309c1..640ec0e6 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ExtensionModule.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ExtensionModule.java
@@ -11,6 +11,9 @@
package org.eclipse.m2e.core.internal.embedder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import com.google.inject.AbstractModule;
import com.google.inject.name.Names;
@@ -20,13 +23,13 @@ import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
/**
* A custom Guice module that picks the components contributed by extensions.
*/
class ExtensionModule extends AbstractModule implements IMavenComponentContributor.IMavenComponentBinder {
+ private static final Logger log = LoggerFactory.getLogger(ExtensionModule.class);
public <T> void bind(Class<T> role, Class<? extends T> impl, String hint) {
if(hint == null || hint.length() <= 0 || "default".equals(hint)) { //$NON-NLS-1$
@@ -44,10 +47,9 @@ class ExtensionModule extends AbstractModule implements IMavenComponentContribut
IMavenComponentContributor contributor = (IMavenComponentContributor) c.createExecutableExtension("class"); //$NON-NLS-1$
contributor.contribute(this);
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
}
}
-
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java
index e9142b62..7b3aec43 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java
@@ -23,13 +23,14 @@ import java.util.zip.ZipFile;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
import org.eclipse.m2e.core.embedder.MavenRuntime;
import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
@@ -42,6 +43,7 @@ import org.eclipse.m2e.core.internal.Messages;
* @author Igor Fedorenko
*/
public class MavenEmbeddedRuntime implements MavenRuntime {
+ private static final Logger log = LoggerFactory.getLogger(MavenEmbeddedRuntime.class);
private static final String MAVEN_MAVEN_EMBEDDER_BUNDLE_ID = "org.eclipse.m2e.maven.runtime"; //$NON-NLS-1$
@@ -114,7 +116,7 @@ public class MavenEmbeddedRuntime implements MavenRuntime {
cp.add(file);
}
} catch(IOException ex) {
- MavenLogger.log("Error adding classpath entry " + url.toString(), ex);
+ log.error("Error adding classpath entry " + url.toString(), ex);
}
}
}
@@ -185,7 +187,7 @@ public class MavenEmbeddedRuntime implements MavenRuntime {
zip.close();
}
} catch(Exception e) {
- MavenLogger.log("Could not determine embedded maven version", e);
+ log.error("Could not determine embedded maven version", e);
}
return Messages.MavenEmbeddedRuntime_unknown;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExternalRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExternalRuntime.java
index e11f84b1..4ae3277a 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExternalRuntime.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExternalRuntime.java
@@ -18,6 +18,9 @@ import java.util.Properties;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -28,7 +31,6 @@ import org.codehaus.plexus.classworlds.launcher.ConfigurationParser;
import org.codehaus.plexus.util.DirectoryScanner;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
import org.eclipse.m2e.core.embedder.MavenRuntime;
import org.eclipse.m2e.core.internal.Messages;
@@ -41,6 +43,7 @@ import org.eclipse.m2e.core.internal.Messages;
*
*/
public class MavenExternalRuntime implements MavenRuntime {
+ private static final Logger log = LoggerFactory.getLogger(MavenExternalRuntime.class);
private static final String PROPERTY_MAVEN_HOME = "maven.home"; //$NON-NLS-1$
@@ -227,13 +230,11 @@ public class MavenExternalRuntime implements MavenRuntime {
zip.close();
}
}
-
} catch (Exception e) {
// most likely a bad location, but who knows
- MavenLogger.log("Could not parse classwords configuration file", e);
+ log.error("Could not parse classwords configuration file", e);
}
-
return Messages.MavenExternalRuntime_unknown;
- }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
index 73da4f91..4b7d2fd2 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
@@ -28,6 +28,9 @@ import java.util.HashSet;
import java.util.List;
import java.util.Properties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -142,7 +145,6 @@ import org.sonatype.aether.transfer.TransferListener;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.ILocalRepositoryListener;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
@@ -154,6 +156,7 @@ import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
+ private static final Logger log = LoggerFactory.getLogger(MavenImpl.class);
/**
* Id of maven core class realm
@@ -255,7 +258,7 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
try {
return ((DefaultMaven) lookup(Maven.class)).newRepositorySession(request);
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
throw new IllegalStateException("Could not look up Maven embedder", ex);
}
}
@@ -354,7 +357,7 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
} catch(SettingsBuildingException ex) {
String msg = "Could not read settings.xml, assuming default values";
MavenPlugin.getDefault().getConsole().logError(msg);
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
/*
* NOTE: This method provides input for various other core functions, just bailing out would make m2e highly
* unusuable. Instead, we fail gracefully and just ignore the broken settings, using defaults.
@@ -414,7 +417,7 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
try {
listener.settingsChanged(settings);
} catch(CoreException e) {
- MavenLogger.log(e);
+ log.error(e.getMessage(), e);
}
}
}
@@ -423,8 +426,7 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest(server);
SettingsDecryptionResult result = lookup(SettingsDecrypter.class).decrypt(request);
for(SettingsProblem problem : result.getProblems()) {
- MavenLogger.log(new Status(IStatus.WARNING, IMavenConstants.PLUGIN_ID, -1, problem.getMessage(), problem
- .getException()));
+ log.warn(problem.getMessage(), problem.getException());
}
return result.getServer();
}
@@ -518,9 +520,9 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
request = (ProjectBuildingRequest) f.get(project);
request.setRepositorySession(lookup(ContextRepositorySystemSession.class));
} catch(NoSuchFieldException ex) {
- MavenLogger.log(ex.getMessage(), ex);
+ log.error(ex.getMessage(), ex);
} catch(IllegalAccessException ex) {
- MavenLogger.log(ex.getMessage(), ex);
+ log.error(ex.getMessage(), ex);
}
}
@@ -543,7 +545,7 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
return lookup(ProjectBuilder.class).build(parentArtifact, configuration).getProject();
}
} catch(ProjectBuildingException ex) {
- MavenLogger.log("Could not read parent project", ex);
+ log.error("Could not read parent project", ex);
}
return null;
@@ -847,7 +849,7 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
try {
world.disposeRealm(realm.getId());
} catch(NoSuchRealmException ex) {
- MavenLogger.log("Could not dispose of project extensions class realm", ex);
+ log.error("Could not dispose of project extensions class realm", ex);
}
}
}
@@ -926,7 +928,7 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
try {
repositories.add(0, lookup(RepositorySystem.class).createDefaultRemoteRepository());
} catch(InvalidRepositoryException ex) {
- MavenLogger.log("Unexpected exception", ex);
+ log.error("Unexpected exception", ex);
}
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/WagonTransferListenerAdapter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/WagonTransferListenerAdapter.java
index e1c26c16..371df9c3 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/WagonTransferListenerAdapter.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/WagonTransferListenerAdapter.java
@@ -13,6 +13,9 @@ package org.eclipse.m2e.core.internal.embedder;
import java.io.File;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -25,7 +28,6 @@ import org.apache.maven.wagon.events.TransferEvent;
import org.apache.maven.wagon.events.TransferListener;
import org.apache.maven.wagon.repository.Repository;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.embedder.ILocalRepositoryListener;
@@ -33,6 +35,8 @@ import org.eclipse.m2e.core.embedder.ILocalRepositoryListener;
* @author Eugene Kuleshov
*/
final class WagonTransferListenerAdapter extends AbstractTransferListenerAdapter implements TransferListener {
+ private static final Logger log = LoggerFactory.getLogger(WagonTransferListenerAdapter.class);
+
// TODO this is just wrong!
private final GavCalculator gavCalculator = new M2GavCalculator();
@@ -110,7 +114,7 @@ final class WagonTransferListenerAdapter extends AbstractTransferListenerAdapter
listener.artifactInstalled(repoBasedir, artifactKey, artifactFile);
}
} catch (Exception ex) {
- MavenLogger.log("Could not notify local repository listeners", ex);
+ log.error("Could not notify local repository listeners", ex);
}
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java
index 2068b6e9..45f92706 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java
@@ -33,6 +33,9 @@ import java.util.Set;
import java.util.TreeMap;
import java.util.WeakHashMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -81,7 +84,6 @@ import org.apache.maven.wagon.proxy.ProxyInfo;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.embedder.ArtifactRepositoryRef;
import org.eclipse.m2e.core.embedder.IMaven;
@@ -110,6 +112,7 @@ import org.eclipse.m2e.core.repository.IRepositoryRegistry;
* @author Eugene Kuleshov
*/
public class NexusIndexManager implements IndexManager, IMavenProjectChangedListener, IRepositoryIndexer {
+ private static final Logger log = LoggerFactory.getLogger(NexusIndexManager.class);
public static final int MIN_CLASS_QUERY_LENGTH = 6;
@@ -202,7 +205,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
fullCreators.add(mavenArchetype);
} catch(ComponentLookupException ce) {
String msg = "Error looking up component ";
- MavenLogger.log(msg, ce);
+ log.error(msg, ce);
}
}
return fullCreators;
@@ -219,7 +222,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
minCreators.add(mavenArchetype);
} catch(ComponentLookupException ce) {
String msg = "Error looking up component ";
- MavenLogger.log(msg, ce);
+ log.error(msg, ce);
}
}
@@ -247,7 +250,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
}
} catch(Exception ex) {
String msg = "Illegal artifact coordinate " + ex.getMessage();
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
Messages.NexusIndexManager_error_search, ex));
}
@@ -532,7 +535,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
}
MavenPlugin.getDefault().getConsole().logMessage("Updated local repository index");
} catch(Exception ex) {
- MavenLogger.log("Unable to re-index " + repository.toString(), ex);
+ log.error("Unable to re-index " + repository.toString(), ex);
throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
Messages.NexusIndexManager_error_reindexing, ex));
} finally {
@@ -552,7 +555,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
facade.getArtifactKey());
}
} catch(Exception ex) {
- MavenLogger.log("Unable to re-index " + workspaceRepository.toString(), ex);
+ log.error("Unable to re-index " + workspaceRepository.toString(), ex);
throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
Messages.NexusIndexManager_error_reindexing, ex));
} finally {
@@ -578,7 +581,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
getIndexer().addArtifactToIndex(artifactContext, context);
} catch(Exception ex) {
String msg = "Unable to add " + getDocumentKey(key);
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
}
}
}
@@ -601,7 +604,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
IndexingContext context = getIndexingContext(repository);
if(context == null) {
String msg = "Unable to find document to remove" + getDocumentKey(key);
- MavenLogger.log(new Status(IStatus.ERROR, "org.eclipse.m2e", msg)); //$NON-NLS-1$
+ log.error(msg); //$NON-NLS-1$
return;
}
ArtifactContext artifactContext;
@@ -617,7 +620,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
getIndexer().deleteArtifactFromIndex(artifactContext, context);
} catch(Exception ex) {
String msg = "Unable to remove " + getDocumentKey(key);
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
}
}
@@ -848,7 +851,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
return g;
} catch(CoreException ex) {
- MavenLogger.log("Can't retrieve groups for " + repository.toString() + ":" + prefix, ex); //$NON-NLS-2$
+ log.error("Can't retrieve groups for " + repository.toString() + ":" + prefix, ex); //$NON-NLS-2$
return group;
}
}
@@ -923,7 +926,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
}
} catch(IOException ex) {
String msg = "Error changing index details " + repository.toString();
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
Messages.NexusIndexManager_error_add_repo, ex));
}
@@ -974,7 +977,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
getIndexer().removeIndexingContext(context, false);
} catch(IOException ie) {
String msg = "Unable to delete files for index";
- MavenLogger.log(msg, ie);
+ log.error(msg, ie);
}
}
@@ -1153,7 +1156,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList
MavenPlugin.getDefault().getConsole().logError(msg);
} catch(Exception ie) {
String msg = "Unable to update index for " + repository.toString();
- MavenLogger.log(msg, ie);
+ log.error(msg, ie);
MavenPlugin.getDefault().getConsole().logError(msg);
} finally {
fireIndexChanged(repository);
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecycle/LifecycleMappingFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecycle/LifecycleMappingFactory.java
index 2b598ba0..7f9178a7 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecycle/LifecycleMappingFactory.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecycle/LifecycleMappingFactory.java
@@ -62,7 +62,6 @@ import org.apache.maven.project.MavenProject;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.internal.Messages;
import org.eclipse.m2e.core.internal.embedder.MavenImpl;
@@ -86,7 +85,7 @@ import org.eclipse.m2e.core.project.configurator.MojoExecutionKey;
* @author igor
*/
public class LifecycleMappingFactory {
- private static Logger log = LoggerFactory.getLogger(LifecycleMappingFactory.class);
+ private static final Logger log = LoggerFactory.getLogger(LifecycleMappingFactory.class);
public static final String LIFECYCLE_MAPPING_PLUGIN_GROUPID = "org.eclipse.m2e"; //$NON-NLS-1$
@@ -154,7 +153,7 @@ public class LifecycleMappingFactory {
instantiateProjectConfigurators(result, result.getMojoExecutionMapping());
}
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
result.addProblem(new MavenProblemInfo(0, ex.getMessage())); // XXX that looses most of useful info
} finally {
log.info("Using {} lifecycle mapping for {}.", result.getLifecycleMappingId(), projectFacade.toString()); //$NON-NLS-1$
@@ -502,7 +501,7 @@ public class LifecycleMappingFactory {
mapping.setName(element.getAttribute(ATTR_NAME));
return mapping;
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
return null;
}
@@ -550,7 +549,7 @@ public class LifecycleMappingFactory {
return configurator;
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
return null;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
index 3a6dfdea..37cb98f2 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
@@ -11,6 +11,9 @@
package org.eclipse.m2e.core.internal.preferences;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.DefaultScope;
@@ -21,13 +24,13 @@ import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.embedder.IMavenConfigurationChangeListener;
import org.eclipse.m2e.core.embedder.MavenConfigurationChangeEvent;
public class MavenConfigurationImpl implements IMavenConfiguration, IPreferenceChangeListener {
+ private static final Logger log = LoggerFactory.getLogger(MavenConfigurationImpl.class);
private final IEclipsePreferences[] preferencesLookup = new IEclipsePreferences[2];
@@ -112,7 +115,7 @@ public class MavenConfigurationImpl implements IMavenConfiguration, IPreferenceC
try {
((IMavenConfigurationChangeListener) listener).mavenConfigutationChange(mavenEvent);
} catch(Exception e) {
- MavenLogger.log("Could not deliver maven configuration change event", e);
+ log.error("Could not deliver maven configuration change event", e);
}
}
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
index 8abf15d6..da2fc15e 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
@@ -68,7 +68,6 @@ import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory;
import org.eclipse.m2e.core.archetype.ArchetypeManager;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.embedder.MavenModelManager;
@@ -100,7 +99,7 @@ import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
*/
public class ProjectConfigurationManager implements IProjectConfigurationManager, IMavenProjectChangedListener,
IResourceChangeListener {
- private static Logger log = LoggerFactory.getLogger(ProjectConfigurationManager.class);
+ private static final Logger log = LoggerFactory.getLogger(ProjectConfigurationManager.class);
final MavenProjectManager projectManager;
@@ -164,7 +163,7 @@ public class ProjectConfigurationManager implements IProjectConfigurationManager
Method m = IResource.class.getMethod("setHidden", boolean.class); //$NON-NLS-1$
m.invoke(resource, Boolean.TRUE);
} catch (Exception ex) {
- MavenLogger.log("Failed to hide resource; " + resource.getLocation().toOSString(), ex);
+ log.error("Failed to hide resource; " + resource.getLocation().toOSString(), ex);
}
}
@@ -489,7 +488,7 @@ public class ProjectConfigurationManager implements IProjectConfigurationManager
Exception cause = result.getCause();
if(cause != null) {
String msg = NLS.bind(Messages.ProjectConfigurationManager_error_unable_archetype, archetype.toString());
- MavenLogger.log(msg, cause);
+ log.error(msg, cause);
throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, cause));
}
monitor.worked(1);
@@ -688,7 +687,7 @@ public class ProjectConfigurationManager implements IProjectConfigurationManager
}
}
} catch (CoreException e) {
- MavenLogger.log(e);
+ log.error(e.getMessage(), e);
}
}
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java
index a2f84921..c73bf1cb 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java
@@ -18,6 +18,9 @@ import java.io.IOException;
import java.io.OutputStream;
import java.util.Properties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -28,7 +31,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.apache.maven.artifact.Artifact;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
@@ -38,6 +40,7 @@ import org.eclipse.m2e.core.project.MavenProjectManager;
* Maintains map file of maven artifacts present in workspace.
*/
public class WorkspaceStateWriter implements IMavenProjectChangedListener {
+ private static final Logger log = LoggerFactory.getLogger(WorkspaceStateWriter.class);
private MavenProjectManager projectManager;
@@ -68,7 +71,7 @@ public class WorkspaceStateWriter implements IMavenProjectChangedListener {
state.put(key, outputLocation.getLocation().toFile().getCanonicalPath());
}
} catch (CoreException ex) {
- MavenLogger.log("Error writing workspace state file", ex);
+ log.error("Error writing workspace state file", ex);
}
}
@@ -78,10 +81,8 @@ public class WorkspaceStateWriter implements IMavenProjectChangedListener {
} finally {
buf.close();
}
-
} catch(IOException ex) {
- MavenLogger.log("Error writing workspace state file", ex);
+ log.error("Error writing workspace state file", ex);
}
}
-
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
index a961280d..ff886360 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
@@ -65,7 +65,6 @@ import org.apache.maven.repository.DelegatingLocalArtifactRepository;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.core.MavenConsole;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
@@ -90,8 +89,7 @@ import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
* provides mapping between Maven and the workspace.
*/
public class ProjectRegistryManager {
-
- private static Logger log = LoggerFactory.getLogger(ProjectRegistryManager.class);
+ private static final Logger log = LoggerFactory.getLogger(ProjectRegistryManager.class);
static final String ARTIFACT_TYPE_POM = "pom"; //$NON-NLS-1$
static final String ARTIFACT_TYPE_JAR = "jar"; //$NON-NLS-1$
@@ -188,7 +186,7 @@ public class ProjectRegistryManager {
String msg = "Failed to read Maven project";
console.logError(msg);
console.logError(ex.toString());
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
}
}
}
@@ -210,7 +208,7 @@ public class ProjectRegistryManager {
projectNode.flush();
return true;
} catch(BackingStoreException ex) {
- MavenLogger.log("Failed to save resolver configuration", ex);
+ log.error("Failed to save resolver configuration", ex);
}
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java
index 56452fae..9af0cc86 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java
@@ -26,6 +26,8 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.Version;
import org.osgi.service.packageadmin.PackageAdmin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -37,7 +39,6 @@ import org.eclipse.osgi.service.resolver.VersionRange;
import org.codehaus.plexus.util.IOUtil;
import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.MavenLogger;
/**
@@ -46,6 +47,7 @@ import org.eclipse.m2e.core.core.MavenLogger;
* @author Eugene Kuleshov
*/
public class ProjectRegistryReader {
+ private static final Logger log = LoggerFactory.getLogger(ProjectRegistryReader.class);
private static final String WORKSPACE_STATE = "workspaceState.ser"; //$NON-NLS-1$
@@ -97,7 +99,7 @@ public class ProjectRegistryReader {
};
return (ProjectRegistry) is.readObject();
} catch(Exception ex) {
- MavenLogger.log("Can't read workspace state", ex);
+ log.error("Can't read workspace state", ex);
} finally {
IOUtil.close(is);
}
@@ -168,7 +170,7 @@ public class ProjectRegistryReader {
os.writeObject(state);
}
} catch(Exception ex) {
- MavenLogger.log("Can't write workspace state", ex);
+ log.error("Can't write workspace state", ex);
} finally {
IOUtil.close(os);
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob.java
index 2f527fff..c2847b29 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob.java
@@ -16,6 +16,9 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -37,13 +40,13 @@ import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChange
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.internal.Messages;
import org.eclipse.m2e.core.jobs.IBackgroundProcessingQueue;
import org.eclipse.m2e.core.project.MavenUpdateRequest;
public class ProjectRegistryRefreshJob extends Job implements IResourceChangeListener, IPreferenceChangeListener, IBackgroundProcessingQueue {
+ private static final Logger log = LoggerFactory.getLogger(ProjectRegistryRefreshJob.class);
private static final int DELTA_FLAGS = IResourceDelta.CONTENT | IResourceDelta.MOVED_FROM | IResourceDelta.MOVED_TO
| IResourceDelta.COPIED_FROM | IResourceDelta.REPLACED;
@@ -98,13 +101,10 @@ public class ProjectRegistryRefreshJob extends Job implements IResourceChangeLis
} finally {
newState.close();
}
-
} catch(CoreException ex) {
- MavenLogger.log(ex);
-
+ log.error(ex.getMessage(), ex);
} catch(OperationCanceledException ex) {
MavenPlugin.getDefault().getConsole().logMessage("Refreshing Maven model is canceled");
-
} catch (StaleMutableProjectRegistryException e) {
synchronized(this.queue) {
this.queue.addAll(0, requests);
@@ -112,13 +112,10 @@ public class ProjectRegistryRefreshJob extends Job implements IResourceChangeLis
schedule(1000L);
}
}
-
} catch(Exception ex) {
- MavenLogger.log(ex.getMessage(), ex);
-
+ log.error(ex.getMessage(), ex);
} finally {
monitor.done();
-
}
return Status.OK_STATUS;
@@ -146,7 +143,7 @@ public class ProjectRegistryRefreshJob extends Job implements IResourceChangeLis
try {
projectChanged(projectDeltas[i], removeProjects, refreshProjects);
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistry.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistry.java
index 03179291..14df8f00 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistry.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistry.java
@@ -20,6 +20,9 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -29,7 +32,6 @@ import org.apache.maven.settings.Server;
import org.apache.maven.settings.Settings;
import org.apache.maven.wagon.authentication.AuthenticationInfo;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.ArtifactRepositoryRef;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.embedder.ISettingsChangeListener;
@@ -47,6 +49,7 @@ import org.eclipse.m2e.core.repository.IRepositoryRegistry;
* @author igor
*/
public class RepositoryRegistry implements IRepositoryRegistry, IMavenProjectChangedListener, ISettingsChangeListener {
+ private static final Logger log = LoggerFactory.getLogger(RepositoryRegistry.class);
private final IMaven maven;
@@ -95,7 +98,7 @@ public class RepositoryRegistry implements IRepositoryRegistry, IMavenProjectCha
try {
localUrl = localBasedir.toURL().toExternalForm();
} catch(MalformedURLException ex) {
- MavenLogger.log("Could not parse local repository path", ex);
+ log.error("Could not parse local repository path", ex);
localUrl = "file://" + localBasedir.getAbsolutePath(); //$NON-NLS-1$
}
@@ -113,7 +116,7 @@ public class RepositoryRegistry implements IRepositoryRegistry, IMavenProjectCha
try {
settings = maven.getSettings();
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
for(MavenProjectChangedEvent event : events) {
@@ -126,7 +129,7 @@ public class RepositoryRegistry implements IRepositoryRegistry, IMavenProjectCha
try {
addProjectRepositories(settings, facade, null /*asyncUpdate*/);
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
}
@@ -157,7 +160,7 @@ public class RepositoryRegistry implements IRepositoryRegistry, IMavenProjectCha
try {
indexer.repositoryAdded(repository, monitor);
} catch (CoreException e) {
- MavenLogger.log(e);
+ log.error(e.getMessage(), e);
}
}
}
@@ -184,7 +187,7 @@ public class RepositoryRegistry implements IRepositoryRegistry, IMavenProjectCha
try {
indexer.repositoryRemoved(repository, monitor);
} catch (CoreException e) {
- MavenLogger.log(e);
+ log.error(e.getMessage(), e);
}
}
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectInfo.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectInfo.java
index 64088a15..85b62efc 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectInfo.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectInfo.java
@@ -20,15 +20,17 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
-import org.apache.maven.model.Model;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import org.eclipse.m2e.core.core.MavenLogger;
+import org.apache.maven.model.Model;
/**
* @author Eugene Kuleshov
*/
public class MavenProjectInfo {
+ private static final Logger log = LoggerFactory.getLogger(MavenProjectInfo.class);
/**
* Project basedir must NOT be renamed on filesystem.
@@ -132,7 +134,7 @@ public class MavenProjectInfo {
if(i==null) {
projects.put(key, info);
} else {
- MavenLogger.log("Project info " + this + " already has a child project info with key '" + key + "'"); //$NON-NLS-3$
+ log.error("Project info " + this + " already has a child project info with key '" + key + "'"); //$NON-NLS-3$
for(Iterator<String> it = info.getProfiles().iterator(); it.hasNext();) {
i.addProfile(it.next());
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java
index f63c5a68..e9510e24 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java
@@ -18,6 +18,9 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.runtime.CoreException;
@@ -36,7 +39,6 @@ import org.apache.maven.plugin.MojoExecution;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.core.MavenConsole;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.internal.Messages;
@@ -56,6 +58,7 @@ import org.eclipse.m2e.core.project.MavenProjectManager;
* @author Igor Fedorenko
*/
public abstract class AbstractProjectConfigurator implements IExecutableExtension, IMavenProjectChangedListener {
+ private static final Logger log = LoggerFactory.getLogger(AbstractProjectConfigurator.class);
public static final String ATTR_ID = "id"; //$NON-NLS-1$
@@ -133,7 +136,7 @@ public abstract class AbstractProjectConfigurator implements IExecutableExtensio
try {
mavenProjectChanged(events[i], monitor);
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
index 12b383d1..52182a9d 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
@@ -19,6 +19,9 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -41,7 +44,6 @@ import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.project.MavenProject;
import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.internal.M2EUtils;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.IProjectConfigurationManager;
@@ -60,6 +62,7 @@ import org.eclipse.m2e.jdt.MavenJdtPlugin;
* @author igor
*/
public abstract class AbstractJavaProjectConfigurator extends AbstractProjectConfigurator {
+ private static final Logger log = LoggerFactory.getLogger(AbstractJavaProjectConfigurator.class);
private static final String GOAL_COMPILE = "compile";
@@ -236,13 +239,13 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
try {
inclusion = toPaths(maven.getMojoParameterValue(request.getMavenSession(), compile, "includes", String[].class)); //$NON-NLS-1$
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
console.logError("Failed to determine compiler inclusions, assuming defaults");
}
try {
exclusion = toPaths(maven.getMojoParameterValue(request.getMavenSession(), compile, "excludes", String[].class)); //$NON-NLS-1$
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
console.logError("Failed to determine compiler exclusions, assuming defaults");
}
}
@@ -253,14 +256,14 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
inclusionTest = toPaths(maven.getMojoParameterValue(request.getMavenSession(), compile,
"testIncludes", String[].class)); //$NON-NLS-1$
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
console.logError("Failed to determine compiler test inclusions, assuming defaults");
}
try {
exclusionTest = toPaths(maven.getMojoParameterValue(request.getMavenSession(), compile,
"testExcludes", String[].class)); //$NON-NLS-1$
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
console.logError("Failed to determine compiler test exclusions, assuming defaults");
}
}
@@ -398,7 +401,7 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
try {
source = maven.getMojoParameterValue(session, execution, parameter, String.class);
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
console.logError("Failed to determine compiler " + parameter + " setting, assuming default");
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java
index 7096bf7a..dfc292ed 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/BuildPathManager.java
@@ -27,6 +27,8 @@ import java.util.zip.ZipFile;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -66,7 +68,6 @@ import org.apache.maven.project.MavenProject;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.core.MavenConsole;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
@@ -87,6 +88,7 @@ import org.eclipse.m2e.jdt.MavenJdtPlugin;
*/
@SuppressWarnings("restriction")
public class BuildPathManager implements IMavenProjectChangedListener, IResourceChangeListener, IClasspathManager {
+ private static final Logger log = LoggerFactory.getLogger(BuildPathManager.class);
// local repository variable
public static final String M2_REPO = "M2_REPO"; //$NON-NLS-1$
@@ -234,7 +236,7 @@ public class BuildPathManager implements IMavenProjectChangedListener, IResource
forcePackageExplorerRefresh(javaProject);
saveContainerState(project, container);
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
}
@@ -246,13 +248,13 @@ public class BuildPathManager implements IMavenProjectChangedListener, IResource
is = new FileOutputStream(containerStateFile);
new MavenClasspathContainerSaveHelper().writeContainer(container, is);
} catch(IOException ex) {
- MavenLogger.log("Can't save classpath container state for " + project.getName(), ex); //$NON-NLS-1$
+ log.error("Can't save classpath container state for " + project.getName(), ex); //$NON-NLS-1$
} finally {
if(is != null) {
try {
is.close();
} catch(IOException ex) {
- MavenLogger.log("Can't close output stream for " + containerStateFile.getAbsolutePath(), ex); //$NON-NLS-1$
+ log.error("Can't close output stream for " + containerStateFile.getAbsolutePath(), ex); //$NON-NLS-1$
}
}
}
@@ -279,7 +281,7 @@ public class BuildPathManager implements IMavenProjectChangedListener, IResource
try {
is.close();
} catch(IOException ex) {
- MavenLogger.log("Can't close output stream for " + containerStateFile.getAbsolutePath(), ex); //$NON-NLS-1$
+ log.error("Can't close output stream for " + containerStateFile.getAbsolutePath(), ex); //$NON-NLS-1$
}
}
}
@@ -620,13 +622,13 @@ public class BuildPathManager implements IMavenProjectChangedListener, IResource
// remove custom source and javadoc configuration
File attachmentProperties = getSourceAttachmentPropertiesFile((IProject) event.getResource());
if(attachmentProperties.exists() && !attachmentProperties.delete()) {
- MavenLogger.log("Can't delete " + attachmentProperties.getAbsolutePath(), null); //$NON-NLS-1$
+ log.error("Can't delete " + attachmentProperties.getAbsolutePath()); //$NON-NLS-1$
}
// remove classpath container state
File containerState = getContainerStateFile((IProject) event.getResource());
if(containerState.exists() && !containerState.delete()) {
- MavenLogger.log("Can't delete " + containerState.getAbsolutePath(), null); //$NON-NLS-1$
+ log.error("Can't delete " + containerState.getAbsolutePath()); //$NON-NLS-1$
}
}
}
@@ -642,7 +644,7 @@ public class BuildPathManager implements IMavenProjectChangedListener, IResource
new NullProgressMonitor());
changed = !newPath.equals(oldPath);
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
changed = false;
}
return changed;
@@ -787,7 +789,7 @@ public class BuildPathManager implements IMavenProjectChangedListener, IResource
}
}
} catch(CoreException e) {
- MavenLogger.log("Could not schedule sources/javadoc download", e); //$NON-NLS-1$
+ log.error("Could not schedule sources/javadoc download", e); //$NON-NLS-1$
}
}
@@ -808,7 +810,7 @@ public class BuildPathManager implements IMavenProjectChangedListener, IResource
}
}
} catch(CoreException e) {
- MavenLogger.log("Could not schedule sources/javadoc download", e); //$NON-NLS-1$
+ log.error("Could not schedule sources/javadoc download", e); //$NON-NLS-1$
}
}
@@ -873,7 +875,7 @@ public class BuildPathManager implements IMavenProjectChangedListener, IResource
javaProject.setRawClasspath(cp, monitor);
} catch(CoreException e) {
- MavenLogger.log(e);
+ log.error(e.getMessage(), e);
}
}
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java
index b8892701..45c58d47 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java
@@ -25,8 +25,8 @@ import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.jdt.IClasspathManager;
import org.eclipse.m2e.jdt.IClasspathEntryDescriptor;
+import org.eclipse.m2e.jdt.IClasspathManager;
/**
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesActionDelegate.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesActionDelegate.java
index 7a9c2ff2..1b8e6eb9 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesActionDelegate.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesActionDelegate.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.m2e.jdt.internal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.internal.ui.javaeditor.IClassFileEditorInput;
@@ -18,7 +21,6 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorActionDelegate;
import org.eclipse.ui.IEditorPart;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.jdt.IClasspathManager;
import org.eclipse.m2e.jdt.MavenJdtPlugin;
@@ -31,6 +33,7 @@ import org.eclipse.m2e.jdt.MavenJdtPlugin;
@SuppressWarnings("restriction")
public class DownloadSourcesActionDelegate implements IEditorActionDelegate {
+ private static final Logger log = LoggerFactory.getLogger(DownloadSourcesActionDelegate.class);
public void setActiveEditor(IAction action, IEditorPart part) {
@@ -54,7 +57,7 @@ public class DownloadSourcesActionDelegate implements IEditorActionDelegate {
}
}
} catch(Exception ex) {
- MavenLogger.log("Could not schedule source download", ex); //$NON-NLS-1$
+ log.error("Could not schedule source download", ex); //$NON-NLS-1$
}
}
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java
index c013c3a3..cfcc2fdb 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DownloadSourcesJob.java
@@ -40,7 +40,6 @@ import org.apache.maven.project.MavenProject;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.MavenConsole;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.jobs.IBackgroundProcessingQueue;
@@ -244,7 +243,7 @@ class DownloadSourcesJob extends Job implements IBackgroundProcessingQueue {
}
private void logMessage(String msg, CoreException e) {
- MavenLogger.log(msg, e);
+ log.error(msg, e);
console.logMessage(msg);
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java
index 791c0cf1..a93684d6 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java
@@ -11,6 +11,9 @@
package org.eclipse.m2e.jdt.internal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -24,7 +27,6 @@ import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer;
import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer.RequiredProjectWrapper;
import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectManager;
@@ -39,6 +41,7 @@ import org.eclipse.m2e.jdt.MavenJdtPlugin;
*/
@SuppressWarnings({"restriction","rawtypes"})
public class JavaElementsAdapterFactory implements IAdapterFactory {
+ private static final Logger log = LoggerFactory.getLogger(JavaElementsAdapterFactory.class);
private static final Class[] ADAPTER_LIST = new Class[] {ArtifactKey.class, IPath.class, IMavenProjectFacade.class};
@@ -55,7 +58,7 @@ public class JavaElementsAdapterFactory implements IAdapterFactory {
try {
return getBuildPathManager().findArtifact(project, fragment.getPath());
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
MavenPlugin.getDefault().getConsole().logError("Can't find artifact for " + fragment);
return null;
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java
index 4a932c89..bb7625da 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java
@@ -11,6 +11,9 @@
package org.eclipse.m2e.jdt.internal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -25,7 +28,6 @@ import org.eclipse.jdt.core.JavaCore;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.project.MavenProjectManager;
import org.eclipse.m2e.core.project.MavenUpdateRequest;
@@ -38,6 +40,7 @@ import org.eclipse.m2e.jdt.MavenJdtPlugin;
* @author Eugene Kuleshov
*/
public class MavenClasspathContainerInitializer extends ClasspathContainerInitializer {
+ private static final Logger log = LoggerFactory.getLogger(MavenClasspathContainerInitializer.class);
public void initialize(IPath containerPath, IJavaProject project) {
if(MavenClasspathHelpers.isMaven2ClasspathContainer(containerPath)) {
@@ -49,7 +52,7 @@ public class MavenClasspathContainerInitializer extends ClasspathContainerInitia
return;
}
} catch(CoreException ex) {
- MavenLogger.log("Exception initializing classpath container " + containerPath.toString(), ex);
+ log.error("Exception initializing classpath container " + containerPath.toString(), ex);
}
// force refresh if can't read persisted state
@@ -71,7 +74,7 @@ public class MavenClasspathContainerInitializer extends ClasspathContainerInitia
try {
getBuildPathManager().persistAttachedSourcesAndJavadoc(project, containerSuggestion, monitor);
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
return new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, 0, Messages.MavenClasspathContainerInitializer_error_cannot_persist, ex);
}
return Status.OK_STATUS;
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenJdtImages.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenJdtImages.java
index fb741584..09eaa718 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenJdtImages.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenJdtImages.java
@@ -11,12 +11,14 @@
package org.eclipse.m2e.jdt.internal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.jdt.MavenJdtPlugin;
@@ -24,6 +26,7 @@ import org.eclipse.m2e.jdt.MavenJdtPlugin;
* @author Eugene Kuleshov
*/
public class MavenJdtImages {
+ private static final Logger log = LoggerFactory.getLogger(MavenJdtImages.class);
// object images
@@ -46,7 +49,7 @@ public class MavenJdtImages {
return imageDescriptor;
}
} catch(Exception ex) {
- MavenLogger.log(key, ex);
+ log.error(key, ex);
}
return null;
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java
index 01ab6ba4..aadf240e 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java
@@ -15,6 +15,9 @@ import java.io.File;
import java.net.URL;
import java.util.List;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -36,7 +39,6 @@ import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.ui.internal.actions.SelectionUtil;
@@ -48,6 +50,7 @@ import org.eclipse.m2e.jdt.internal.Messages;
* @author Eugene Kuleshov
*/
public class OpenJavaDocAction extends ActionDelegate {
+ private static final Logger log = LoggerFactory.getLogger(OpenJavaDocAction.class);
public static final String ID = "org.eclipse.m2e.openJavaDocAction"; //$NON-NLS-1$
@@ -78,7 +81,7 @@ public class OpenJavaDocAction extends ActionDelegate {
}.schedule();
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
MessageDialog.openInformation(Display.getDefault().getActiveShell(), //
@@ -116,13 +119,13 @@ public class OpenJavaDocAction extends ActionDelegate {
name, name, name);
browser.openURL(helpUrl);
} catch(PartInitException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
});
} catch(CoreException ex) {
- MavenLogger.log("Can't download JavaDoc for " + name, ex);
+ log.error("Can't download JavaDoc for " + name, ex);
openDialog(NLS.bind(Messages.OpenJavaDocAction_error_download,name));
// TODO search index and offer to select other version
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenLaunchConfigurationListener.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenLaunchConfigurationListener.java
index 71690b46..7849b155 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenLaunchConfigurationListener.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenLaunchConfigurationListener.java
@@ -11,6 +11,9 @@
package org.eclipse.m2e.jdt.internal.launch;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -20,11 +23,11 @@ import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
public class MavenLaunchConfigurationListener implements ILaunchConfigurationListener, IMavenProjectChangedListener {
+ private static final Logger log = LoggerFactory.getLogger(MavenLaunchConfigurationListener.class);
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
updateLaunchConfiguration(configuration);
@@ -51,7 +54,7 @@ public class MavenLaunchConfigurationListener implements ILaunchConfigurationLis
MavenRuntimeClasspathProvider.enable(configuration);
}
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
@@ -69,7 +72,7 @@ public class MavenLaunchConfigurationListener implements ILaunchConfigurationLis
break;
}
} catch (Exception e) {
- MavenLogger.log("Could not update launch configuration", e);
+ log.error("Could not update launch configuration", e);
}
}
}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/filter/MavenModuleFilter.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/filter/MavenModuleFilter.java
index 4088655f..f4e403b9 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/filter/MavenModuleFilter.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/filter/MavenModuleFilter.java
@@ -11,6 +11,9 @@
package org.eclipse.m2e.jdt.internal.ui.filter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@@ -22,7 +25,6 @@ import org.apache.maven.project.MavenProject;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectManager;
@@ -32,6 +34,7 @@ import org.eclipse.m2e.core.project.MavenProjectManager;
* @author Eugene Kuleshov
*/
public class MavenModuleFilter extends ViewerFilter {
+ private static final Logger log = LoggerFactory.getLogger(MavenModuleFilter.class);
public boolean select(Viewer viewer, Object parentElement, Object element) {
if(element instanceof IFolder) {
@@ -59,7 +62,7 @@ public class MavenModuleFilter extends ViewerFilter {
}
}
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
diff --git a/org.eclipse.m2e.launching/META-INF/MANIFEST.MF b/org.eclipse.m2e.launching/META-INF/MANIFEST.MF
index 774b5eab..05951e55 100644
--- a/org.eclipse.m2e.launching/META-INF/MANIFEST.MF
+++ b/org.eclipse.m2e.launching/META-INF/MANIFEST.MF
@@ -24,7 +24,8 @@ Require-Bundle: org.eclipse.core.resources,
org.eclipse.m2e.maven.runtime;bundle-version="[0.13.0,0.14.0)",
org.eclipse.m2e.core;bundle-version="[0.13.0,0.14.0)",
com.ibm.icu;bundle-version="4.0.1",
- org.eclipse.m2e.core.ui;bundle-version="[0.13.0,0.14.0)"
+ org.eclipse.m2e.core.ui;bundle-version="[0.13.0,0.14.0)",
+ org.slf4j.api;bundle-version="1.5.11"
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
JavaSE-1.6
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
index 39fdcc83..78796491 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
@@ -47,7 +47,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectManager;
import org.eclipse.m2e.core.project.ResolverConfiguration;
@@ -62,6 +61,8 @@ import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -71,6 +72,7 @@ import org.eclipse.ui.dialogs.ElementListSelectionDialog;
* @author Eugene Kuleshov
*/
public class ExecutePomAction implements ILaunchShortcut, IExecutableExtension {
+ private static final Logger log = LoggerFactory.getLogger(ExecutePomAction.class);
private boolean showDialog = false;
@@ -143,7 +145,7 @@ public class ExecutePomAction implements ILaunchShortcut, IExecutableExtension {
String goals = launchConfiguration.getAttribute(MavenLaunchConstants.ATTR_GOALS, (String) null);
openDialog = goals == null || goals.trim().length() == 0;
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
@@ -216,7 +218,7 @@ public class ExecutePomAction implements ILaunchShortcut, IExecutableExtension {
return workingCopy;
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
return null;
}
@@ -346,7 +348,7 @@ public class ExecutePomAction implements ILaunchShortcut, IExecutableExtension {
}
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
@@ -366,7 +368,7 @@ public class ExecutePomAction implements ILaunchShortcut, IExecutableExtension {
return workingCopy.doSave();
} catch(Exception ex) {
- MavenLogger.log("Error creating new launch configuration", ex);
+ log.error("Error creating new launch configuration", ex);
}
return null;
}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java
index 7023f497..2f7bae5a 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java
@@ -35,6 +35,9 @@ import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
import org.eclipse.m2e.actions.MavenLaunchConstants;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
@@ -43,10 +46,8 @@ import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.IHyperlink;
import org.eclipse.ui.ide.IDE;
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.MavenLogger;
-import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -55,6 +56,7 @@ import org.eclipse.m2e.core.project.MavenProjectManager;
* @author Eugene Kuleshov
*/
public class MavenConsoleLineTracker implements IConsoleLineTracker {
+ private static final Logger log = LoggerFactory.getLogger(MavenConsoleLineTracker.class);
private static final String PLUGIN_ID = "org.eclipse.m2e.launching"; //$NON-NLS-1$
@@ -120,7 +122,7 @@ public class MavenConsoleLineTracker implements IConsoleLineTracker {
} catch(BadLocationException ex) {
// ignore
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
}
@@ -137,7 +139,7 @@ public class MavenConsoleLineTracker implements IConsoleLineTracker {
ILaunchConfigurationType type = launchConfiguration.getType();
return PLUGIN_ID.equals(type.getPluginIdentifier());
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
return false;
}
}
@@ -233,7 +235,7 @@ public class MavenConsoleLineTracker implements IConsoleLineTracker {
try {
IDE.openEditor(page, new MavenFileEditorInput(reportFile.getAbsolutePath()), desc.getId());
} catch(PartInitException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
}
@@ -265,7 +267,7 @@ public class MavenConsoleLineTracker implements IConsoleLineTracker {
try {
launchRemoteJavaApp(baseDir, portString);
} catch (CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenFileEditorInput.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenFileEditorInput.java
index 56fffd5c..7e6c1f73 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenFileEditorInput.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenFileEditorInput.java
@@ -23,13 +23,12 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IPersistableElement;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.editors.text.ILocationProvider;
-import org.eclipse.m2e.core.core.IMavenConstants;
-
/**
* Maven file editor input
*
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
index 87cab6c4..9ac8550d 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
@@ -38,12 +38,14 @@ import org.eclipse.m2e.actions.MavenLaunchConstants;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.core.MavenConsole;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class MavenLaunchDelegate extends JavaLaunchDelegate implements MavenLaunchConstants {
+ private static final Logger log = LoggerFactory.getLogger(MavenLaunchDelegate.class);
private static final String LAUNCHER_TYPE = "org.codehaus.classworlds.Launcher"; //$NON-NLS-1$
private static final String LAUNCHER_TYPE3 = "org.codehaus.plexus.classworlds.launcher.Launcher"; // classwordls 2.0 //$NON-NLS-1$
@@ -200,7 +202,7 @@ public class MavenLaunchDelegate extends JavaLaunchDelegate implements MavenLaun
}
} catch(CoreException e) {
String msg = "Exception while getting configuration attribute " + ATTR_PROPERTIES;
- MavenLogger.log(msg, e);
+ log.error(msg, e);
}
try {
@@ -210,7 +212,7 @@ public class MavenLaunchDelegate extends JavaLaunchDelegate implements MavenLaun
}
} catch(CoreException ex) {
String msg = "Exception while getting configuration attribute " + ATTR_PROFILES;
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
}
return sb.toString();
@@ -335,7 +337,7 @@ public class MavenLaunchDelegate extends JavaLaunchDelegate implements MavenLaun
RefreshTab.refreshResources(configuration, monitor);
return Status.OK_STATUS;
} catch (CoreException e) {
- MavenLogger.log(e);
+ log.error(e.getMessage(), e);
return e.getStatus();
}
}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java
index 6b8e5532..c76a5734 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java
@@ -26,7 +26,6 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.m2e.actions.MavenLaunchConstants;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
import org.eclipse.m2e.core.embedder.MavenRuntime;
@@ -34,6 +33,8 @@ import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectManager;
import org.eclipse.osgi.util.NLS;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.ibm.icu.util.StringTokenizer;
@@ -43,6 +44,7 @@ import com.ibm.icu.util.StringTokenizer;
* @author Igor Fedorenko
*/
public class MavenLaunchUtils {
+ private static final Logger log = LoggerFactory.getLogger(MavenLaunchUtils.class);
public static MavenRuntime getMavenRuntime(ILaunchConfiguration configuration) throws CoreException {
MavenRuntimeManager runtimeManager = MavenPlugin.getDefault().getMavenRuntimeManager();
@@ -104,7 +106,7 @@ public class MavenLaunchUtils {
collector.addArchiveEntry(file.getAbsolutePath());
}
} catch(CoreException ex) {
- MavenLogger.log("Artifact not found " + name, ex);
+ log.error("Artifact not found " + name, ex);
}
}
}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
index 05f84bd8..669e04e5 100644
--- a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
@@ -37,7 +37,6 @@ import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.m2e.actions.MavenLaunchConstants;
import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.core.Messages;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.embedder.MavenRuntime;
@@ -70,6 +69,8 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -80,6 +81,7 @@ import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
*/
@SuppressWarnings("restriction")
public class MavenLaunchMainTab extends AbstractLaunchConfigurationTab implements MavenLaunchConstants {
+ private static final Logger log = LoggerFactory.getLogger(MavenLaunchMainTab.class);
public static final String ID_EXTERNAL_TOOLS_LAUNCH_GROUP = "org.eclipse.ui.externaltools.launchGroup"; //$NON-NLS-1$
@@ -603,7 +605,7 @@ public class MavenLaunchMainTab extends AbstractLaunchConfigurationTab implement
try {
return configuration.getAttribute(name, defaultValue);
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
return defaultValue;
}
}
diff --git a/org.eclipse.m2e.refactoring/META-INF/MANIFEST.MF b/org.eclipse.m2e.refactoring/META-INF/MANIFEST.MF
index 4fd741a4..4b8c7af7 100644
--- a/org.eclipse.m2e.refactoring/META-INF/MANIFEST.MF
+++ b/org.eclipse.m2e.refactoring/META-INF/MANIFEST.MF
@@ -20,7 +20,8 @@ Require-Bundle: org.eclipse.m2e.core;bundle-version="[0.13.0,0.14.0)",
org.eclipse.ui.ide,
org.eclipse.ltk.core.refactoring,
org.eclipse.ltk.ui.refactoring;visibility:=reexport,
- org.eclipse.m2e.core.ui;bundle-version="[0.13.0,0.14.0)"
+ org.eclipse.m2e.core.ui;bundle-version="[0.13.0,0.14.0)",
+ org.slf4j.api;bundle-version="1.5.11"
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
JavaSE-1.6
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
index 12882164..b9c4edfd 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
@@ -44,7 +44,6 @@ import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectManager;
@@ -53,6 +52,8 @@ import org.eclipse.m2e.model.edit.pom.PropertyElement;
import org.eclipse.m2e.refactoring.RefactoringModelResources.PropertyInfo;
import org.eclipse.m2e.refactoring.internal.Activator;
import org.eclipse.osgi.util.NLS;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -62,6 +63,7 @@ import org.eclipse.osgi.util.NLS;
*/
@SuppressWarnings("restriction")
public abstract class AbstractPomRefactoring extends Refactoring {
+ private static final Logger log = LoggerFactory.getLogger(AbstractPomRefactoring.class);
protected static final String PROBLEMS_DURING_REFACTORING = Messages.AbstractPomRefactoring_error;
@@ -314,7 +316,7 @@ public abstract class AbstractPomRefactoring extends Refactoring {
Resource resource = MavenPlugin.getDefault().getMavenModelManager().loadResource(file);
return (Model) resource.getContents().get(0);
} catch(CoreException ex) {
- MavenLogger.log(PROBLEMS_DURING_REFACTORING, ex);
+ log.error(PROBLEMS_DURING_REFACTORING, ex);
return null;
}
}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/ChangeCreator.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/ChangeCreator.java
index 5a49dc99..8bb0368d 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/ChangeCreator.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/ChangeCreator.java
@@ -22,13 +22,14 @@ import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.ltk.core.refactoring.TextFileChange;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.text.edits.DeleteEdit;
import org.eclipse.text.edits.InsertEdit;
import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.text.edits.ReplaceEdit;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.text.edits.TextEditGroup;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -37,6 +38,8 @@ import org.eclipse.text.edits.TextEditGroup;
* @author Anton Kraev
*/
public class ChangeCreator {
+ private static final Logger log = LoggerFactory.getLogger(ChangeCreator.class);
+
private String label;
private IDocument oldDocument;
@@ -139,7 +142,7 @@ public class ChangeCreator {
try {
return getHash(thisIndex).equals(((LineComparator) other).getHash(otherIndex));
} catch (BadLocationException e) {
- MavenLogger.log("Problem comparing", e);
+ log.error("Problem comparing", e);
return false;
}
}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/RefactoringModelResources.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/RefactoringModelResources.java
index c47bd0d8..a6dc79a3 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/RefactoringModelResources.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/RefactoringModelResources.java
@@ -28,10 +28,11 @@ import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.model.edit.pom.Model;
import org.eclipse.m2e.model.edit.pom.PropertyElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* This class manages all refactoring-related resources for a particular maven project
@@ -39,6 +40,8 @@ import org.eclipse.m2e.model.edit.pom.PropertyElement;
* @author Anton Kraev
*/
public class RefactoringModelResources {
+ private static final Logger log = LoggerFactory.getLogger(RefactoringModelResources.class);
+
private static final String TMP_PROJECT_NAME = ".m2eclipse_refactoring"; //$NON-NLS-1$
protected IFile pomFile;
protected IFile tmpFile;
@@ -61,7 +64,7 @@ public class RefactoringModelResources {
tmpProject.create(null);
tmpProject.open(null);
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
return tmpProject;
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringImages.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringImages.java
index 949c5ef8..41cb9dfe 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringImages.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringImages.java
@@ -13,13 +13,15 @@ package org.eclipse.m2e.refactoring.internal;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author Eugene Kuleshov
*/
public class RefactoringImages {
+ private static final Logger log = LoggerFactory.getLogger(RefactoringImages.class);
// images
@@ -39,7 +41,7 @@ public class RefactoringImages {
}
return imageDescriptor;
} catch (Exception ex) {
- MavenLogger.log(key, ex);
+ log.error(key, ex);
return null;
}
}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactAction.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactAction.java
index 0556df63..3ded0280 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactAction.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactAction.java
@@ -16,13 +16,14 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.refactoring.internal.SaveDirtyFilesDialog;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionDelegate;
import org.eclipse.ui.internal.ObjectPluginAction;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -30,6 +31,7 @@ import org.eclipse.ui.internal.ObjectPluginAction;
*/
@SuppressWarnings("restriction")
public class RenameArtifactAction extends ActionDelegate {
+ private static final Logger log = LoggerFactory.getLogger(RenameArtifactAction.class);
@Override
public void init(IAction action) {
@@ -71,9 +73,8 @@ public class RenameArtifactAction extends ActionDelegate {
String titleForFailedChecks = ""; //$NON-NLS-1$
op.run(shell, titleForFailedChecks);
} catch(Exception e) {
- MavenLogger.log("Unable to rename " + file, e);
+ log.error("Unable to rename " + file, e);
}
}
-
}
diff --git a/org.eclipse.m2e.scm/META-INF/MANIFEST.MF b/org.eclipse.m2e.scm/META-INF/MANIFEST.MF
index c339e64a..199087ad 100644
--- a/org.eclipse.m2e.scm/META-INF/MANIFEST.MF
+++ b/org.eclipse.m2e.scm/META-INF/MANIFEST.MF
@@ -24,4 +24,5 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="3.5.2",
org.eclipse.m2e.core.ui;bundle-version="[0.13.0,0.14.0)",
org.eclipse.ui.workbench;bundle-version="3.6.1",
org.eclipse.ui.ide;bundle-version="3.6.1",
- org.eclipse.jdt.core;bundle-version="3.6.1";resolution:=optional
+ org.eclipse.jdt.core;bundle-version="3.6.1";resolution:=optional,
+ org.slf4j.api;bundle-version="1.5.11"
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java
index 9b889666..d8508e28 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java
@@ -17,12 +17,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osgi.util.NLS;
-
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
@@ -32,15 +26,19 @@ import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.maven.model.Profile;
import org.apache.maven.model.Scm;
-
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.core.MavenConsole;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.embedder.MavenModelManager;
import org.eclipse.m2e.core.internal.Messages;
import org.eclipse.m2e.core.project.AbstractProjectScanner;
+import org.eclipse.osgi.util.NLS;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Maven project scanner using dependency list
@@ -48,6 +46,7 @@ import org.eclipse.m2e.core.project.AbstractProjectScanner;
* @author Eugene Kuleshov
*/
public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProjectScmInfo> {
+ private static final Logger log = LoggerFactory.getLogger(MavenProjectPomScanner.class);
private final boolean developer;
@@ -145,7 +144,7 @@ public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProje
addError(ex);
String msg = "Error reading " + d.getArtifactId();
console.logError(msg);
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
}
}
}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/ScmHandlerFactory.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/ScmHandlerFactory.java
index 396ecf7f..41890ac1 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/ScmHandlerFactory.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/ScmHandlerFactory.java
@@ -23,10 +23,11 @@ import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.scm.ScmUrl;
import org.eclipse.m2e.scm.spi.ScmHandler;
import org.eclipse.m2e.scm.spi.ScmHandlerUi;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -35,7 +36,7 @@ import org.eclipse.m2e.scm.spi.ScmHandlerUi;
* @author Eugene Kuleshov
*/
public class ScmHandlerFactory {
-
+ private static final Logger log = LoggerFactory.getLogger(ScmHandlerFactory.class);
public static final String EXTENSION_SCM_HANDLERS = "org.eclipse.m2e.scm.scmHandlers"; //$NON-NLS-1$
@@ -119,7 +120,7 @@ public class ScmHandlerFactory {
try {
scmHandlers.add((ScmHandler) element.createExecutableExtension(ScmHandler.ATTR_CLASS));
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
}
@@ -141,7 +142,7 @@ public class ScmHandlerFactory {
try {
scmHandlerUis.add((ScmHandlerUi) element.createExecutableExtension(ScmHandlerUi.ATTR_CLASS));
} catch(CoreException ex) {
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
}
}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
index 053926db..6be6cccd 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
@@ -38,9 +38,7 @@ import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.MavenConsole;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.embedder.MavenModelManager;
-import org.eclipse.m2e.scm.internal.Messages;
import org.eclipse.m2e.core.project.IMavenProjectImportResult;
import org.eclipse.m2e.core.project.LocalProjectScanner;
import org.eclipse.m2e.core.project.MavenProjectInfo;
@@ -51,6 +49,7 @@ import org.eclipse.m2e.core.ui.internal.wizards.MavenImportWizard;
import org.eclipse.m2e.core.ui.internal.wizards.ProjectsImportWizard;
import org.eclipse.m2e.scm.MavenCheckoutOperation;
import org.eclipse.m2e.scm.MavenProjectScmInfo;
+import org.eclipse.m2e.scm.internal.Messages;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
@@ -59,6 +58,8 @@ import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.NewProjectAction;
import org.eclipse.ui.progress.IProgressConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -67,6 +68,7 @@ import org.eclipse.ui.progress.IProgressConstants;
* @author Eugene Kuleshov
*/
public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
+ private static final Logger log = LoggerFactory.getLogger(MavenProjectCheckoutJob.class);
final ProjectImportConfiguration configuration;
@@ -250,11 +252,9 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
} catch(IOException ex) {
String msg = "Can't delete " + location;
console.logError(msg + "; " + (ex.getMessage()==null ? ex.toString() : ex.getMessage())); //$NON-NLS-1$
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
}
}
}
-
}
-
}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandler.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandler.java
index 9ca4d0c9..f5f8efd1 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandler.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandler.java
@@ -18,8 +18,9 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.scm.MavenProjectScmInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* An SCM handler base class
@@ -27,6 +28,7 @@ import org.eclipse.m2e.scm.MavenProjectScmInfo;
* @author Eugene Kuleshov
*/
public abstract class ScmHandler implements Comparable<ScmHandler>, IExecutableExtension {
+ private static final Logger log = LoggerFactory.getLogger(ScmHandler.class);
public static final String ATTR_CLASS = "class"; //$NON-NLS-1$
public static final String ATTR_TYPE = "type"; //$NON-NLS-1$
@@ -78,7 +80,7 @@ public abstract class ScmHandler implements Comparable<ScmHandler>, IExecutableE
try {
this.priority = Integer.parseInt(priority);
} catch(Exception ex) {
- MavenLogger.log("Unable to parse priority for " + handlerClass, ex);
+ log.error("Unable to parse priority for " + handlerClass, ex);
}
}
}

Back to the top