Maven Integration for Eclipse
  1. Maven Integration for Eclipse
  2. MNGECLIPSE-157

Runtime exceptions in embedder should be caught and logged by the plugin.

    Details

    • Type: Wish Wish
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.0.9
    • Fix Version/s: 0.0.11
    • Component/s: Dependency Resolver
    • Labels:
      None
    • Number of attachments :
      3

      Description

      When inserting a dependency (in my case jaxen) which has a dependency of it's own (xercesImpl) to a project that has a parent which has the same dependency (xercesImpl) already declared (scope was system) a NullPointerException emerges to the WTP xml editors topmost row and classpath container doesn't show anymore any of the dependencies. Workspace log file and console did not show any anomalities.

      With standalone maven everything work just fine, but with embedder I managed to pull out a following stacktrace

      java.lang.NullPointerException
      at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:82)
      at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:63)
      at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:233)
      at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:211)
      at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:192)
      at org.apache.maven.project.DefaultMavenProjectBuilder.buildWithDependencies(DefaultMavenProjectBuilder.java:342)
      at org.apache.maven.project.DefaultMavenProjectBuilder.buildWithDependencies(DefaultMavenProjectBuilder.java:289)
      at org.apache.maven.embedder.MavenEmbedder.readProjectWithDependencies(MavenEmbedder.java:277)
      at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:53)

      This seemed very familiar and here's a link <http://jira.codehaus.org/browse/MPIR-2> to another project. This issue has been around for quite a while and despite the status FIXED, I don't think this actually is fixed but at least it has been patched couple of times. Workaround: Add an exclusion clause to the new dependency if you have it's dependencies already declared in parent.

      What is left for this project could be a more informative way to express runtime exceptions/errors when embedder fails to do so. NullPointerException in the xml editor gives a wrong expression where the problem actually resides. I'd prefer m2 console over eclipse workspace log.

      1. child.pom
        0.4 kB
        Tuomas Kiviaho
      2. parent.pom
        0.5 kB
        Tuomas Kiviaho
      1. NullPointerException.jpg
        53 kB

        Issue Links

          Activity

          Hide
          Tuomas Kiviaho added a comment -

          Sample case

          Show
          Tuomas Kiviaho added a comment - Sample case
          Hide
          Eugene Kuleshov added a comment -

          Please attach simple Eclipse project and exact steps how to reproduce this issue.

          Show
          Eugene Kuleshov added a comment - Please attach simple Eclipse project and exact steps how to reproduce this issue.
          Hide
          Tuomas Kiviaho added a comment -

          Here are two poms where one is parent and one child. Parent has "managed" dependency with system scope. Child has identical but transient dependency.

          Show
          Tuomas Kiviaho added a comment - Here are two poms where one is parent and one child. Parent has "managed" dependency with system scope. Child has identical but transient dependency.
          Hide
          Tuomas Kiviaho added a comment -

          Eclipse Webtools Editor cranking up.

          1.8.2006 11:15:47 EEST: [DEBUG] test:test:jar:0.0.1 (selected for null)
          1.8.2006 11:15:47 EEST: [DEBUG] jaxen:jaxen:jar:1.1-beta-9:compile (selected for compile)
          1.8.2006 11:15:47 EEST: [DEBUG] jaxen:jaxen:jar:1.1-beta-6:compile (removed - causes a cycle in the graph)
          1.8.2006 11:15:47 EEST: [DEBUG] dom4j:dom4j:jar:1.6.1:compile (selected for compile)
          1.8.2006 11:15:47 EEST: [DEBUG] jaxen:jaxen:jar:1.0-FCS:compile (removed - causes a cycle in the graph)
          1.8.2006 11:15:47 EEST: [DEBUG] jdom:jdom:jar:1.0:compile (selected for compile)
          1.8.2006 11:15:47 EEST: [DEBUG] xom:xom:jar:1.0b3:compile (selected for compile)
          1.8.2006 11:15:47 EEST: [DEBUG] xerces:xercesImpl:jar:2.2.1:compile (applying version: 2.7.1;applying scope: system)
          1.8.2006 11:15:47 EEST: [DEBUG] xerces:xercesImpl:jar:2.7.1:system (selected for system)
          1.8.2006 11:15:47 EEST: [DEBUG] xalan:xalan:jar:2.6.0:compile (selected for compile)
          1.8.2006 11:15:47 EEST: [DEBUG] While downloading xml-apis:xml-apis:2.0.2
          This artifact has been relocated to xml-apis:xml-apis:1.0.b2.

          Show
          Tuomas Kiviaho added a comment - Eclipse Webtools Editor cranking up. 1.8.2006 11:15:47 EEST: [DEBUG] test:test:jar:0.0.1 (selected for null) 1.8.2006 11:15:47 EEST: [DEBUG] jaxen:jaxen:jar:1.1-beta-9:compile (selected for compile) 1.8.2006 11:15:47 EEST: [DEBUG] jaxen:jaxen:jar:1.1-beta-6:compile (removed - causes a cycle in the graph) 1.8.2006 11:15:47 EEST: [DEBUG] dom4j:dom4j:jar:1.6.1:compile (selected for compile) 1.8.2006 11:15:47 EEST: [DEBUG] jaxen:jaxen:jar:1.0-FCS:compile (removed - causes a cycle in the graph) 1.8.2006 11:15:47 EEST: [DEBUG] jdom:jdom:jar:1.0:compile (selected for compile) 1.8.2006 11:15:47 EEST: [DEBUG] xom:xom:jar:1.0b3:compile (selected for compile) 1.8.2006 11:15:47 EEST: [DEBUG] xerces:xercesImpl:jar:2.2.1:compile (applying version: 2.7.1;applying scope: system) 1.8.2006 11:15:47 EEST: [DEBUG] xerces:xercesImpl:jar:2.7.1:system (selected for system) 1.8.2006 11:15:47 EEST: [DEBUG] xalan:xalan:jar:2.6.0:compile (selected for compile) 1.8.2006 11:15:47 EEST: [DEBUG] While downloading xml-apis:xml-apis:2.0.2 This artifact has been relocated to xml-apis:xml-apis:1.0.b2.
          Hide
          Eugene Kuleshov added a comment -

          I updated exception handling and the error marker. Error logged to the console and the stack trace goes into error log.

          Will follow up an NPE itself with Maven folks...

          Show
          Eugene Kuleshov added a comment - I updated exception handling and the error marker. Error logged to the console and the stack trace goes into error log. Will follow up an NPE itself with Maven folks...
          Hide
          Eugene Kuleshov added a comment -

          Jason, can you please look at this. It seems like last embedder chokes on the projects like this:

          Parent:

          <?xml version="1.0" encoding="UTF-8"?>
          <project>
          <modelVersion>4.0.0</modelVersion>
          <groupId>org.maven.ide.eclipse.projects</groupId>
          <artifactId>MNGECLIPSE-157parent</artifactId>
          <packaging>pom</packaging>
          <name>MNGECLIPSE-157parent</name>
          <version>0.0.1</version>
          <dependencyManagement>
          <dependencies>
          <dependency>
          <groupId>xerces</groupId>
          <artifactId>xercesImpl</artifactId>
          <version>2.7.1</version>
          <scope>system</scope>
          <systemPath>$

          {basedir}

          /lib/xercesImpl-2.7.1.jar</systemPath>
          </dependency>
          </dependencies>
          </dependencyManagement>
          </project>

          Child:

          <?xml version="1.0" encoding="UTF-8"?>
          <project>
          <modelVersion>4.0.0</modelVersion>
          <parent>
          <groupId>org.maven.ide.eclipse.projects</groupId>
          <artifactId>MNGECLIPSE-157parent</artifactId>
          <version>0.0.1</version>
          </parent>
          <groupId>org.maven.ide.eclipse.projects</groupId>
          <artifactId>MNGECLIPSE-157child</artifactId>
          <dependencies>
          <dependency>
          <groupId>jaxen</groupId>
          <artifactId>jaxen</artifactId>
          <version>1.1-beta-9</version>
          </dependency>
          </dependencies>
          </project>

          Show
          Eugene Kuleshov added a comment - Jason, can you please look at this. It seems like last embedder chokes on the projects like this: Parent: <?xml version="1.0" encoding="UTF-8"?> <project> <modelVersion>4.0.0</modelVersion> <groupId>org.maven.ide.eclipse.projects</groupId> <artifactId> MNGECLIPSE-157 parent</artifactId> <packaging>pom</packaging> <name> MNGECLIPSE-157 parent</name> <version>0.0.1</version> <dependencyManagement> <dependencies> <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.7.1</version> <scope>system</scope> <systemPath>$ {basedir} /lib/xercesImpl-2.7.1.jar</systemPath> </dependency> </dependencies> </dependencyManagement> </project> Child: <?xml version="1.0" encoding="UTF-8"?> <project> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.maven.ide.eclipse.projects</groupId> <artifactId> MNGECLIPSE-157 parent</artifactId> <version>0.0.1</version> </parent> <groupId>org.maven.ide.eclipse.projects</groupId> <artifactId> MNGECLIPSE-157 child</artifactId> <dependencies> <dependency> <groupId>jaxen</groupId> <artifactId>jaxen</artifactId> <version>1.1-beta-9</version> </dependency> </dependencies> </project>
          Hide
          Ryan Sonnek added a comment -

          any update on this? is this blocking the 0.0.11 release? can it be bumped to a later point?

          Show
          Ryan Sonnek added a comment - any update on this? is this blocking the 0.0.11 release? can it be bumped to a later point?
          Hide
          Eugene Kuleshov added a comment -

          Original issue is resolved. Created MNGECLIPSE-388 to track issues with system dependency

          Show
          Eugene Kuleshov added a comment - Original issue is resolved. Created MNGECLIPSE-388 to track issues with system dependency

            People

            • Assignee:
              Eugene Kuleshov
              Reporter:
              Tuomas Kiviaho
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: