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 /org.eclipse.m2e.scm
parentd778f2782d0a1dd50307452f30961bbecf1b1075 (diff)
downloadm2e-core-a1639bf8aa6a6a8ba1575b1a4d183e6815128f6b.tar.gz
m2e-core-a1639bf8aa6a6a8ba1575b1a4d183e6815128f6b.tar.xz
m2e-core-a1639bf8aa6a6a8ba1575b1a4d183e6815128f6b.zip
335872: Replaced MavenLogger with slf4j loggers
Diffstat (limited to 'org.eclipse.m2e.scm')
-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
5 files changed, 24 insertions, 21 deletions
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