Permalink
Browse files

Use slf4j for logging

Signed-off-by: Fred Bricon <fbricon@gmail.com>
  • Loading branch information...
1 parent b99c856 commit 4f0d881f4971ba53524a12525453f662791db0f6 @fbricon fbricon committed Sep 12, 2011
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
@@ -1,5 +1,2 @@
/bin
/target
-/.settings
-/.classpath
-/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.maven.ide.eclipse.wtp.jpt</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,8 @@
+#Thu Sep 08 15:29:57 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
@@ -0,0 +1,5 @@
+#Thu Sep 08 15:29:57 CEST 2011
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
@@ -14,7 +14,9 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.wst.common.modulecore,
org.eclipse.emf.ecore,
org.eclipse.jem.util,
- org.eclipse.wst.common.emfworkbench.integration
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.eclipse.jpt.jpa.core;bundle-version="3.0.1",
+ org.slf4j.api
Bundle-Vendor: Sonatype, Inc.
Export-Package: org.maven.ide.eclipse.wtp.jpt
Bundle-Activator: org.maven.ide.eclipse.wtp.jpt.DaliPluginActivator
@@ -19,8 +19,11 @@
import org.eclipse.jpt.common.core.internal.resource.SimpleJavaResourceLocator;
import org.eclipse.jpt.common.core.resource.ResourceLocator;
import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.embedder.MavenImpl;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Maven resource Locator
@@ -29,6 +32,8 @@
@SuppressWarnings("restriction")
public class MavenResourceLocator implements ResourceLocator {
+ private static final Logger log = LoggerFactory.getLogger(MavenResourceLocator.class);
+
private static IPath META_INF_PATH = new Path("META-INF");
/**
@@ -47,9 +52,13 @@ public boolean acceptResourceLocation(IProject project, IContainer container) {
}
} else {
//Maven project not loaded yet, fallback to default behaviour.
- accept = getDefaultDelegate().acceptResourceLocation(project, container);
+ accept = getDelegate(project).acceptResourceLocation(project, container);
}
- //System.err.println("acceptResourceLocation(" + project +", "+ container + ") ="+ accept );
+ //Sometimes src/main/resources/META-INF is not even sent immediately to this method, resulting in
+ // persistence.xml not being added to the jpaFiles of the jpaProject hence the creation of a
+ // "The persistence.xml file does not have recognized content." error marker
+ log.debug("acceptResourceLocation({}, {}) = {}",new Object[]{project, container, accept});
+
return accept;
}
@@ -91,14 +100,13 @@ public IPath getResourcePath(IProject project, IPath runtimePath) {
}
}
} catch (JavaModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.error("Error getting the resource path", e);
}
}
- System.err.println("getResourcePath (" + project + ", " + runtimePath + ") = " + resourcePath);
+ //System.err.println("getResourcePath (" + project + ", " + runtimePath + ") = " + resourcePath);
if (resourcePath == null) {
- resourcePath = getDefaultDelegate().getResourcePath(project, runtimePath);
+ resourcePath = getDelegate(project).getResourcePath(project, runtimePath);
}
return resourcePath;
}
@@ -127,7 +135,7 @@ public IContainer getDefaultResourceLocation(IProject project) {
if (p != null){
IFolder candidate = root.getFolder(p.append(META_INF_PATH));
if (candidate.exists()) {
- System.err.println("getDefaultResourceLocation = "+candidate);
+ log.debug("getDefaultResourceLocation = {}",candidate);
return candidate;
}
if (defaultLocation == null) {
@@ -138,7 +146,7 @@ public IContainer getDefaultResourceLocation(IProject project) {
}
if (defaultLocation == null) {
- defaultLocation = getDefaultDelegate().getDefaultResourceLocation(project);
+ defaultLocation = getDelegate(project).getDefaultResourceLocation(project);
}
return defaultLocation;
}
@@ -168,7 +176,7 @@ private IMavenProjectFacade getMavenProjectFacade(IProject project) {
public IPath getRuntimePath(IProject project, IPath resourcePath) {
IPath runtimePath = getDelegate(project).getRuntimePath(project, resourcePath);
- System.err.println("getRuntimePath " + project + " : " + resourcePath + " = " + runtimePath);
+ log.debug("getRuntimePath({}, {}) = {}",new Object[]{project, resourcePath, runtimePath});
return runtimePath;
}
}

0 comments on commit 4f0d881

Please sign in to comment.