Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvladt2011-02-10 16:30:34 -0500
committervladt2011-02-10 16:45:44 -0500
commitd778f2782d0a1dd50307452f30961bbecf1b1075 (patch)
tree1c3dc01676ed67d88ddf8b9b780f15a15bee4185 /org.eclipse.m2e.editor.xml
parente461dc3b585b794992d4d0fe349c722bcc7b16fc (diff)
downloadm2e-core-d778f2782d0a1dd50307452f30961bbecf1b1075.tar.gz
m2e-core-d778f2782d0a1dd50307452f30961bbecf1b1075.tar.xz
m2e-core-d778f2782d0a1dd50307452f30961bbecf1b1075.zip
335872: Replaced MavenLogger with slf4j loggers
Diffstat (limited to 'org.eclipse.m2e.editor.xml')
-rw-r--r--org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java16
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java7
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnImages.java8
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnIndexPlugin.java9
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java9
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java29
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java7
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java8
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/XMLSchemaMarkerResolution.java9
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerHoverControl.java5
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java30
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/PomEdits.java3
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java7
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingOperation.java7
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingProposal.java14
16 files changed, 100 insertions, 71 deletions
diff --git a/org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF b/org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF
index 6fab89d7..b5e6fb48 100644
--- a/org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF
+++ b/org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF
@@ -20,7 +20,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui.ide,
org.eclipse.core.filesystem,
org.eclipse.ui.forms,
- 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"
Export-Package: org.eclipse.m2e.editor.xml, org.eclipse.m2e.editor.xml.internal
Bundle-ClassPath: .
Bundle-Vendor: %Bundle-Vendor
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java
index 7543b3db..94fcfac6 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java
@@ -22,6 +22,8 @@ import static org.eclipse.m2e.editor.xml.internal.PomEdits.setText;
import java.io.IOException;
import org.apache.maven.project.MavenProject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -41,7 +43,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.index.IIndex;
import org.eclipse.m2e.core.index.IndexedArtifactFile;
import org.eclipse.m2e.core.ui.internal.dialogs.MavenRepositorySearchDialog;
@@ -51,6 +52,7 @@ import org.eclipse.m2e.editor.xml.internal.PomEdits.OperationTuple;
import org.eclipse.m2e.editor.xml.internal.XmlUtils;
public class InsertArtifactProposal implements ICompletionProposal, ICompletionProposalExtension4, ICompletionProposalExtension5 {
+ private static final Logger log = LoggerFactory.getLogger(InsertArtifactProposal.class);
private ISourceViewer sourceViewer;
private Region region;
@@ -119,9 +121,9 @@ public class InsertArtifactProposal implements ICompletionProposal, ICompletionP
}
}));
} catch(IOException e) {
- MavenLogger.log("Failed inserting parent element", e); //$NON-NLS-1$
+ log.error("Failed inserting parent element", e); //$NON-NLS-1$
} catch(CoreException e) {
- MavenLogger.log("Failed inserting parent element", e); //$NON-NLS-1$
+ log.error("Failed inserting parent element", e); //$NON-NLS-1$
}
}
@@ -175,9 +177,9 @@ public class InsertArtifactProposal implements ICompletionProposal, ICompletionP
}
}));
} catch(IOException e) {
- MavenLogger.log("Failed inserting plugin element", e); //$NON-NLS-1$
+ log.error("Failed inserting plugin element", e); //$NON-NLS-1$
} catch(CoreException e) {
- MavenLogger.log("Failed inserting plugin element", e); //$NON-NLS-1$
+ log.error("Failed inserting plugin element", e); //$NON-NLS-1$
}
}
// dependency type
@@ -223,9 +225,9 @@ public class InsertArtifactProposal implements ICompletionProposal, ICompletionP
}
}));
} catch(IOException e) {
- MavenLogger.log("Failed inserting dependency element", e); //$NON-NLS-1$
+ log.error("Failed inserting dependency element", e); //$NON-NLS-1$
} catch(CoreException e) {
- MavenLogger.log("Failed inserting dependency element", e); //$NON-NLS-1$
+ log.error("Failed inserting dependency element", e); //$NON-NLS-1$
}
}
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java
index 883a5346..24c14c58 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java
@@ -15,6 +15,8 @@ import org.apache.maven.model.InputLocation;
import org.apache.maven.model.InputSource;
import org.apache.maven.model.Model;
import org.apache.maven.project.MavenProject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.text.BadLocationException;
@@ -28,7 +30,6 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.editor.xml.internal.Messages;
/**
* insertion proposal for ${ expressions
@@ -36,6 +37,7 @@ import org.eclipse.m2e.editor.xml.internal.Messages;
*
*/
public class InsertExpressionProposal implements ICompletionProposal, ICompletionProposalExtension5 {
+ private static final Logger log = LoggerFactory.getLogger(InsertExpressionProposal.class);
private MavenProject project;
private String key;
@@ -93,9 +95,8 @@ public class InsertExpressionProposal implements ICompletionProposal, ICompletio
document.replace(offset, region.getLength(), replace);
len = replace.length();
} catch(BadLocationException e) {
- MavenLogger.log("Cannot apply proposal", e);
+ log.error("Cannot apply proposal", e);
}
-
}
public Point getSelection(IDocument document) {
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnImages.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnImages.java
index 90ff8203..faa96fd6 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnImages.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnImages.java
@@ -11,17 +11,19 @@
package org.eclipse.m2e.editor.xml;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.m2e.core.core.MavenLogger;
-
/**
* @author Eugene Kuleshov
*/
public class MvnImages {
+ private static final Logger log = LoggerFactory.getLogger(MvnImages.class);
// object images
@@ -84,7 +86,7 @@ public class MvnImages {
}
return imageDescriptor;
} catch (Exception ex) {
- MavenLogger.log(key, ex);
+ log.error(key, ex);
return null;
}
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnIndexPlugin.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnIndexPlugin.java
index 5e5812df..eb66cbfe 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnIndexPlugin.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnIndexPlugin.java
@@ -13,6 +13,9 @@ package org.eclipse.m2e.editor.xml;
import java.io.IOException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.osgi.framework.BundleContext;
import org.eclipse.jface.text.templates.ContextTypeRegistry;
@@ -21,13 +24,13 @@ import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.m2e.core.core.MavenLogger;
-
/**
* @author Lukas Krecan
*/
public class MvnIndexPlugin extends AbstractUIPlugin {
+ private static final Logger log = LoggerFactory.getLogger(MvnIndexPlugin.class);
+
public static final String PLUGIN_ID = "org.eclipse.m2e.editor.xml"; //$NON-NLS-1$
private static final String TEMPLATES_KEY = PLUGIN_ID + ".templates"; //$NON-NLS-1$
@@ -65,7 +68,7 @@ public class MvnIndexPlugin extends AbstractUIPlugin {
try {
templateStore.load();
} catch(IOException ex) {
- MavenLogger.log("Unable to load pom templates", ex); //$NON-NLS-1$
+ log.error("Unable to load pom templates", ex); //$NON-NLS-1$
}
}
return templateStore;
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java
index bb6c35ce..e4544cc8 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java
@@ -26,6 +26,8 @@ import org.apache.maven.model.Model;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginManagement;
import org.apache.maven.project.MavenProject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -62,7 +64,6 @@ import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.ui.internal.actions.OpenPomAction;
import org.eclipse.m2e.core.ui.internal.actions.OpenPomAction.MavenPathStorageEditorInput;
import org.eclipse.m2e.editor.xml.internal.Messages;
@@ -75,7 +76,7 @@ import org.eclipse.m2e.editor.xml.internal.XmlUtils;
* @author Milos Kleint
*/
public class PomHyperlinkDetector implements IHyperlinkDetector {
-
+ private static final Logger log = LoggerFactory.getLogger(PomHyperlinkDetector.class);
public IHyperlink[] detectHyperlinks(final ITextViewer textViewer, final IRegion region, boolean canShowMultipleHyperlinks) {
if(region == null || textViewer == null) {
@@ -542,7 +543,7 @@ public class PomHyperlinkDetector implements IHyperlinkDetector {
IEditorPart part = OpenPomAction.openEditor(input, name);
reveal(selectEditorPage(part), line, column);
} catch(IOException e) {
- MavenLogger.log("failed opening editor", e);
+ log.error("failed opening editor", e);
}
}
} catch(PartInitException e) {
@@ -581,7 +582,7 @@ public class PomHyperlinkDetector implements IHyperlinkDetector {
int offset = document.getLineOffset(line - 1);
structured.selectAndReveal(offset + column - 1, 0);
} catch(BadLocationException e) {
- MavenLogger.log("failed selecting part of editor", e);
+ log.error("failed selecting part of editor", e);
}
}
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java
index 07bf0ac3..75d52ab0 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java
@@ -16,6 +16,8 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
@@ -54,7 +56,6 @@ import org.eclipse.wst.sse.core.utils.StringUtils;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.internal.lifecycle.model.PluginExecutionAction;
import org.eclipse.m2e.editor.xml.internal.Messages;
import org.eclipse.m2e.editor.xml.internal.NodeOperation;
@@ -62,6 +63,8 @@ import org.eclipse.m2e.editor.xml.internal.XmlUtils;
import org.eclipse.m2e.editor.xml.internal.lifecycle.LifecycleMappingProposal;
public class PomQuickAssistProcessor implements IQuickAssistProcessor {
+ private static final Logger log = LoggerFactory.getLogger(PomQuickAssistProcessor.class);
+
private static final String GROUP_ID_NODE = "groupId"; //$NON-NLS-1$
private static final String ARTIFACT_ID_NODE = "artifactId"; //$NON-NLS-1$
private static final String VERSION_NODE = "version"; //$NON-NLS-1$
@@ -224,7 +227,7 @@ class SchemaCompletionProposal implements ICompletionProposal, ICompletionPropos
}
});
} catch(Exception e) {
- MavenLogger.log("Unable to insert schema info", e); //$NON-NLS-1$
+ log.error("Unable to insert schema info", e); //$NON-NLS-1$
}
}
}
@@ -308,7 +311,7 @@ static class IdPartRemovalProposal implements ICompletionProposal, ICompletionPr
edit.apply(doc);
marker.delete();
} catch(Exception e) {
- MavenLogger.log("Unable to remove the element", e); //$NON-NLS-1$
+ log.error("Unable to remove the element", e); //$NON-NLS-1$
}
}
}
@@ -369,9 +372,9 @@ static class IdPartRemovalProposal implements ICompletionProposal, ICompletionPr
}
});
} catch(IOException e) {
- MavenLogger.log("Error processing marker", e);
+ log.error("Error processing marker", e);
} catch(CoreException e) {
- MavenLogger.log("Error processing marker", e);
+ log.error("Error processing marker", e);
}
}
@@ -412,7 +415,7 @@ static class ManagedVersionRemovalProposal implements ICompletionProposal, IComp
Element artifact = findArtifactElement(root, isdep, marker);
if (artifact == null) {
//TODO report somehow?
- MavenLogger.log("Unable to find the marked element"); //$NON-NLS-1$
+ log.error("Unable to find the marked element"); //$NON-NLS-1$
return;
}
Element value = XmlUtils.findChild(artifact, VERSION_NODE); //$NON-NLS-1$ //$NON-NLS-2$
@@ -433,7 +436,7 @@ static class ManagedVersionRemovalProposal implements ICompletionProposal, IComp
edit.apply(doc);
marker.delete();
} catch(Exception e) {
- MavenLogger.log("Unable to remove the element", e); //$NON-NLS-1$
+ log.error("Unable to remove the element", e); //$NON-NLS-1$
}
}
}
@@ -538,9 +541,9 @@ static class ManagedVersionRemovalProposal implements ICompletionProposal, IComp
}
});
} catch(IOException e) {
- MavenLogger.log("Error processing marker", e);
+ log.error("Error processing marker", e);
} catch(CoreException e) {
- MavenLogger.log("Error processing marker", e);
+ log.error("Error processing marker", e);
}
}
@@ -602,7 +605,7 @@ static class IgnoreWarningProposal implements ICompletionProposal, ICompletionPr
edit.apply(doc);
marker.delete();
} catch(Exception e) {
- MavenLogger.log("Unable to insert", e); //$NON-NLS-1$
+ log.error("Unable to insert", e); //$NON-NLS-1$
}
}
} catch(BadLocationException e1) {
@@ -672,7 +675,7 @@ static class IgnoreWarningProposal implements ICompletionProposal, ICompletionPr
}
}
} catch(BadLocationException e1) {
- MavenLogger.log("Error while computing completion proposal", e1);
+ log.error("Error while computing completion proposal", e1);
}
} finally {
if (domModel != null) {
@@ -694,9 +697,9 @@ static class IgnoreWarningProposal implements ICompletionProposal, ICompletionPr
}
});
} catch(IOException e) {
- MavenLogger.log("Error processing marker", e);
+ log.error("Error processing marker", e);
} catch(CoreException e) {
- MavenLogger.log("Error processing marker", e);
+ log.error("Error processing marker", e);
}
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java
index d728c12f..81a41359 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java
@@ -34,6 +34,8 @@ import org.codehaus.plexus.interpolation.PrefixedObjectValueSource;
import org.codehaus.plexus.interpolation.PropertiesBasedValueSource;
import org.codehaus.plexus.interpolation.RegexBasedInterpolator;
import org.codehaus.plexus.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -43,7 +45,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.templates.Template;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.core.ui.internal.search.util.ArtifactInfo;
import org.eclipse.m2e.core.ui.internal.search.util.Packaging;
@@ -470,6 +471,7 @@ public enum PomTemplateContext {
}
}
};
+ private static final Logger log = LoggerFactory.getLogger(PomTemplateContext.class);
private static final String PREFIX = MvnIndexPlugin.PLUGIN_ID + ".templates.contextType."; //$NON-NLS-1$
@@ -487,7 +489,7 @@ public enum PomTemplateContext {
try {
addTemplates(project, eclipsePrj, templates, node, prefix);
} catch (CoreException e) {
- MavenLogger.log(e);
+ log.error(e.getMessage(), e);
}
return templates.toArray(new Template[templates.size()]);
}
@@ -733,5 +735,4 @@ public enum PomTemplateContext {
private static void add(Collection<Template> proposals, String contextTypeId, String name, String description) {
proposals.add(new Template(name, description, contextTypeId, name, false));
}
-
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java
index c140d2ba..e1cd677d 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java
@@ -26,16 +26,18 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
import org.codehaus.plexus.util.IOUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
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.IMaven;
class PomTemplateContextUtil {
+ private static final Logger log = LoggerFactory.getLogger(PomTemplateContextUtil.class);
public static final PomTemplateContextUtil INSTANCE = new PomTemplateContextUtil();
@@ -78,7 +80,7 @@ class PomTemplateContextUtil {
} catch(Exception ex) {
String msg = "Can't read configuration for " + name; //$NON-NLS-1$
console.logError(msg);
- MavenLogger.log(msg, ex);
+ log.error(msg, ex);
} finally {
IOUtil.close(is);
@@ -97,7 +99,7 @@ class PomTemplateContextUtil {
} else {
console.logError(status.getMessage());
}
- MavenLogger.log(ex);
+ log.error(ex.getMessage(), ex);
}
return null;
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/XMLSchemaMarkerResolution.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/XMLSchemaMarkerResolution.java
index f35edc3d..c24d7610 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/XMLSchemaMarkerResolution.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/XMLSchemaMarkerResolution.java
@@ -11,6 +11,9 @@
package org.eclipse.m2e.editor.xml;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
@@ -23,7 +26,6 @@ import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.editor.xml.internal.Messages;
/**
@@ -32,6 +34,7 @@ import org.eclipse.m2e.editor.xml.internal.Messages;
* @author dyocum
*/
public class XMLSchemaMarkerResolution implements IMarkerResolution {
+ private static final Logger log = LoggerFactory.getLogger(XMLSchemaMarkerResolution.class);
/* (non-Javadoc)
* @see org.eclipse.ui.IMarkerResolution#getLabel()
@@ -60,14 +63,14 @@ public class XMLSchemaMarkerResolution implements IMarkerResolution {
IEditorPart activeEditor = MvnIndexPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
MvnIndexPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().saveEditor(activeEditor, false);
} catch(Exception e){
- MavenLogger.log("Unable to insert schema info", e); //$NON-NLS-1$
+ log.error("Unable to insert schema info", e); //$NON-NLS-1$
}
} else {
String msg = Messages.MavenMarkerResolution_error;
MessageDialog.openError(MvnIndexPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.MavenMarkerResolution_error_title, msg);
}
} catch(Exception e) {
- MavenLogger.log("Unable to run quick fix for maven marker", e); //$NON-NLS-1$
+ log.error("Unable to run quick fix for maven marker", e); //$NON-NLS-1$
}
}
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerHoverControl.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerHoverControl.java
index 87ed2449..2bebfe47 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerHoverControl.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerHoverControl.java
@@ -37,8 +37,6 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.MouseEvent;
@@ -59,7 +57,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolution2;
@@ -68,9 +65,9 @@ import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess;
import org.eclipse.m2e.editor.xml.PomHyperlinkDetector;
-import org.eclipse.m2e.editor.xml.PomTextHover;
import org.eclipse.m2e.editor.xml.PomHyperlinkDetector.ExpressionRegion;
import org.eclipse.m2e.editor.xml.PomHyperlinkDetector.ManagedArtifactRegion;
+import org.eclipse.m2e.editor.xml.PomTextHover;
import org.eclipse.m2e.editor.xml.PomTextHover.CompoundRegion;
import org.eclipse.m2e.editor.xml.PomTextHover.MarkerRegion;
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
index f271afc2..128be22a 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/MarkerLocationService.java
@@ -1,5 +1,12 @@
package org.eclipse.m2e.editor.xml.internal;
+import static org.eclipse.m2e.editor.xml.internal.PomEdits.childEquals;
+import static org.eclipse.m2e.editor.xml.internal.PomEdits.childMissingOrEqual;
+import static org.eclipse.m2e.editor.xml.internal.PomEdits.findChild;
+import static org.eclipse.m2e.editor.xml.internal.PomEdits.findChilds;
+import static org.eclipse.m2e.editor.xml.internal.PomEdits.getTextValue;
+import static org.eclipse.m2e.editor.xml.internal.PomEdits.textEquals;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -11,6 +18,8 @@ import org.apache.maven.model.DependencyManagement;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginManagement;
import org.apache.maven.project.MavenProject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.w3c.dom.Comment;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -20,7 +29,6 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.sse.core.StructuredModelManager;
@@ -33,12 +41,10 @@ import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.internal.markers.IEditorMarkerService;
import org.eclipse.m2e.core.internal.markers.IMarkerLocationService;
import org.eclipse.m2e.core.internal.markers.IMavenMarkerManager;
-
-import static org.eclipse.m2e.editor.xml.internal.PomEdits.*;
+import org.eclipse.m2e.editor.xml.internal.PomEdits.Matcher;
/**
* a service impl used by the core module to improve marker locations and addition of our own markers
@@ -46,6 +52,8 @@ import static org.eclipse.m2e.editor.xml.internal.PomEdits.*;
*
*/
public class MarkerLocationService implements IMarkerLocationService, IEditorMarkerService {
+ private static final Logger log = LoggerFactory.getLogger(MarkerLocationService.class);
+
private static final String XSI_SCHEMA_LOCATION = "xsi:schemaLocation"; //$NON-NLS-1$
private static final String PROJECT_NODE = "project"; //$NON-NLS-1$
@@ -66,9 +74,9 @@ public class MarkerLocationService implements IMarkerLocationService, IEditorMar
}
});
} catch(IOException e) {
- MavenLogger.log("Error locating marker", e);
+ log.error("Error locating marker", e);
} catch(CoreException e) {
- MavenLogger.log("Error locating marker", e);
+ log.error("Error locating marker", e);
}
}
@@ -131,9 +139,9 @@ public class MarkerLocationService implements IMarkerLocationService, IEditorMar
}
});
} catch(IOException e) {
- MavenLogger.log("Error locating marker", e);
+ log.error("Error locating marker", e);
} catch(CoreException e) {
- MavenLogger.log("Error locating marker", e);
+ log.error("Error locating marker", e);
}
}
}
@@ -154,7 +162,7 @@ public class MarkerLocationService implements IMarkerLocationService, IEditorMar
}
marker.setAttribute(IMarker.LINE_NUMBER, structuredDocument.getLineOfOffset(region.getStartOffset()) + 1);
} catch(CoreException e) {
- MavenLogger.log(e);
+ log.error(e.getMessage(), e);
}
}
}
@@ -212,7 +220,7 @@ public class MarkerLocationService implements IMarkerLocationService, IEditorMar
}
}
} catch(Exception ex) {
- MavenLogger.log("Error checking for schema", ex); //$NON-NLS-1$
+ log.error("Error checking for schema", ex); //$NON-NLS-1$
}
finally {
if ( domModel != null ) {
@@ -473,7 +481,7 @@ public class MarkerLocationService implements IMarkerLocationService, IEditorMar
}
}
} catch(Exception t) {
- MavenLogger.log("Error checking for warnings", t); //$NON-NLS-1$
+ log.error("Error checking for warnings", t); //$NON-NLS-1$
} finally {
if(domModel != null) {
domModel.releaseFromRead();
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/PomEdits.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/PomEdits.java
index e23c8538..82c28016 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/PomEdits.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/PomEdits.java
@@ -30,9 +30,6 @@ import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentExtension4;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.text.rules.IStructuredRegion;
import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
index a8529015..31251f6c 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/XmlUtils.java
@@ -19,6 +19,8 @@ import java.util.Stack;
import org.apache.maven.model.InputLocation;
import org.apache.maven.model.InputSource;
import org.apache.maven.project.MavenProject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -26,7 +28,6 @@ import org.eclipse.core.filebuffers.FileBuffers;
import org.eclipse.core.filebuffers.ITextFileBuffer;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -43,7 +44,6 @@ import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
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;
/**
@@ -51,6 +51,7 @@ import org.eclipse.m2e.core.project.IMavenProjectFacade;
* @author mkleint
*/
public class XmlUtils {
+ private static final Logger log = LoggerFactory.getLogger(XmlUtils.class);
public static Element findChild(Element parent, String name) {
return PomEdits.findChild(parent, name);
@@ -182,7 +183,7 @@ public class XmlUtils {
file = new File(maven.getLocalRepositoryPath(), path);
}
} catch(CoreException e) {
- MavenLogger.log("Failed to calculate local repository path of artifact", e);
+ log.error("Failed to calculate local repository path of artifact", e);
}
}
}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingOperation.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingOperation.java
index be47791a..cfd82e1f 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingOperation.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingOperation.java
@@ -28,16 +28,19 @@ import java.util.List;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
import org.apache.maven.artifact.versioning.VersionRange;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.w3c.dom.Comment;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.internal.lifecycle.LifecycleMappingFactory;
import org.eclipse.m2e.core.internal.lifecycle.model.PluginExecutionAction;
import org.eclipse.m2e.editor.xml.internal.PomEdits.Operation;
public class LifecycleMappingOperation implements Operation {
+ private static final Logger log = LoggerFactory.getLogger(LifecycleMappingOperation.class);
+
private static final String LIFECYCLE_PLUGIN_VERSION = LifecycleMappingFactory.LIFECYCLE_MAPPING_PLUGIN_VERSION;
private static final String LIFECYCLE_PLUGIN_ARTIFACTID = LifecycleMappingFactory.LIFECYCLE_MAPPING_PLUGIN_ARTIFACTID;
@@ -97,7 +100,7 @@ public class LifecycleMappingOperation implements Operation {
setText(rangeEl, "[" + version + ",)");
}
} catch(InvalidVersionSpecificationException e) {
- MavenLogger.log("Failed to parse version range:" + versionRange, e);
+ log.error("Failed to parse version range:" + versionRange, e);
}
}
execution = exec;
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingProposal.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingProposal.java
index 7c2c92fe..b241930b 100644
--- a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingProposal.java
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/lifecycle/LifecycleMappingProposal.java
@@ -2,6 +2,9 @@ package org.eclipse.m2e.editor.xml.internal.lifecycle;
import java.io.IOException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
@@ -19,12 +22,13 @@ import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.texteditor.MarkerAnnotation;
import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
import org.eclipse.m2e.core.internal.lifecycle.model.PluginExecutionAction;
import org.eclipse.m2e.editor.xml.internal.Messages;
import org.eclipse.m2e.editor.xml.internal.PomEdits;
public class LifecycleMappingProposal implements ICompletionProposal, ICompletionProposalExtension5, IMarkerResolution {
+ private static final Logger log = LoggerFactory.getLogger(LifecycleMappingProposal.class);
+
private IQuickAssistInvocationContext context;
private final IMarker marker;
@@ -47,9 +51,9 @@ public class LifecycleMappingProposal implements ICompletionProposal, ICompletio
PomEdits.performOnDOMDocument(new PomEdits.OperationTuple(doc, createOperation()));
marker.delete();
} catch(IOException e) {
- MavenLogger.log("Error generating code in pom.xml", e); //$NON-NLS-1$
+ log.error("Error generating code in pom.xml", e); //$NON-NLS-1$
} catch(CoreException e) {
- MavenLogger.log(e);
+ log.error(e.getMessage(), e);
}
}
@@ -115,9 +119,9 @@ public class LifecycleMappingProposal implements ICompletionProposal, ICompletio
PomEdits.performOnDOMDocument(new PomEdits.OperationTuple((IFile) marker.getResource(), createOperation()));
marker.delete();
} catch(IOException e) {
- MavenLogger.log("Error generating code in pom.xml", e); //$NON-NLS-1$
+ log.error("Error generating code in pom.xml", e); //$NON-NLS-1$
} catch(CoreException e) {
- MavenLogger.log(e);
+ log.error(e.getMessage(), e);
}
}

Back to the top