Uploaded image for project: 'Maven Eclipse Plugin (RETIRED)'
  1. Maven Eclipse Plugin (RETIRED)
  2. MECLIPSE-518

NPE when generating WTP configuration files - sometimes - very strange

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.5.1
    • None
    • WTP support
    • None
    • Windows XP, java 1.6, mvn 2.0.9

    Description

      When running mvn eclipse:eclipse -Dwtpversion=2.0 on my project, I get a NullPointerException, but only in some directories! E.g. when the project sources lie in d:\epa-trunk, I get the following output:

      D:\epa-trunk\web>mvn eclipse:eclipse -Dwtpversion=2.0
      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'eclipse'.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building epa-web
      [INFO] task-segment: [eclipse:eclipse]
      [INFO] ------------------------------------------------------------------------
      [INFO] Preparing eclipse:eclipse
      [INFO] [enforcer:enforce

      Unknown macro: {execution}

      ]
      [INFO] [eclipse:eclipse]
      [INFO] Adding support for WTP version 2.0.
      [INFO] Using as WTP server : null
      [INFO] Adding default classpath contaigner: org.eclipse.jdt.launching.JRE_CONTAINER
      [INFO] Using source status cache: D:\epa-trunk\web\target\mvn-eclipse-cache.properties
      [INFO] ------------------------------------------------------------------------
      [ERROR] FATAL ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] null
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      java.lang.NullPointerException
      at org.apache.maven.plugin.ide.IdeDependency.isSystemScopedOutsideProject(IdeDependency.java:519)
      at org.apache.maven.plugin.eclipse.writers.wtp.AbstractWtpResourceWriter.writeWarOrEarResources(AbstractWtpResourceWriter.java:280)
      at org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpComponentWriter.writeModuleTypeComponent(EclipseWtpComponentWriter.java:188)
      at org.apache.maven.plugin.eclipse.writers.wtp.EclipseWtpComponentWriter.write(EclipseWtpComponentWriter.java:105)
      at org.apache.maven.plugin.eclipse.EclipsePlugin.writeConfiguration(EclipsePlugin.java:945)
      at org.apache.maven.plugin.ide.AbstractIdeSupportMojo.execute(AbstractIdeSupportMojo.java:494)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 4 seconds
      [INFO] Finished at: Mon Dec 29 15:00:14 CET 2008
      [INFO] Final Memory: 19M/35M
      [INFO] ------------------------------------------------------------------------

      When moving the sources to d:\tmp, the build completes successfully:

      D:\epa-trunk\web>cd ..\..

      D:\>move epa-trunk tmp

      D:\>cd tmp\epa-trunk\web

      D:\tmp\epa-trunk\web>mvn eclipse:eclipse -Dwtpversion=2.0
      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'eclipse'.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building epa-web
      [INFO] task-segment: [eclipse:eclipse]
      [INFO] ------------------------------------------------------------------------
      [INFO] Preparing eclipse:eclipse
      [INFO] [enforcer:enforce

      Unknown macro: {execution}

      ]
      [INFO] [eclipse:eclipse]
      [INFO] Adding support for WTP version 2.0.
      [INFO] Using as WTP server : null
      [INFO] Adding default classpath contaigner: org.eclipse.jdt.launching.JRE_CONTAINER
      [INFO] Using source status cache: D:\tmp\epa-trunk\web\target\mvn-eclipse-cache.properties
      [INFO] File D:\tmp\epa-trunk\web\.project already exists.
      Additional settings will be preserved, run mvn eclipse:clean if you want old settings to be removed.
      [INFO] Wrote Eclipse project for "epa-web" to D:\tmp\epa-trunk\web.
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 4 seconds
      [INFO] Finished at: Mon Dec 29 15:01:52 CET 2008
      [INFO] Final Memory: 19M/35M
      [INFO] ------------------------------------------------------------------------

      Remarks:

      • web is the web module of my multi-module-project in epa-trunk
      • It's the same for wtpversion=1.5.

      Attachments

        1. MECLIPSE-518.diff
          0.8 kB
          Jon Crater

        Activity

          People

            Unassigned Unassigned
            tchick Martin Monsorno
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: