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

Remove absolute paths from .project and .classpath in PDE mode

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Auto Closed
    • 2.3
    • None
    • PDE support
    • None

    Description

      In PDE mode the Eclipse plugin creates <linkedResources> in the .project
      file. At this point it uses the absolute path of the jar file for the
      <location> element. The same happens with the sourcepath attribute in .classpath.

      Here's an example of what happens:
      .project: <location>/home/max/.m2/repository/ognl/ognl/2.6.9/ognl-2.6.9.jar</location>
      .classpath: <classpathentry kind="lib" path="ognl-2.6.9.jar" sourcepath="/home/max/.m2/repository/ognl/ognl/2.6.9/ognl-2.6.9-sources.jar"/>

      According to the Eclipse documentation the <location> in .project can be "Either an absolute path, or a relative path whose first segment is the name of a workspace path variable."

      So the problem could be solved by defining a "workspace path variable" in Eclipse (not to be confused with the "classpath variable" M2_REPO). This can be done under "Preferences/General/Workspace/Linked Resources" or by adding an entry to ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs.

      So a possible solution would be:
      .project: <location>M2/ognl/ognl/2.6.9/ognl-2.6.9.jar</location>, <location>M2/ognl/ognl/2.6.9/ognl-2.6.9-sources.jar</location>
      .classpath: <classpathentry kind="lib" path="ognl-2.6.9.jar" sourcepath="ognl-2.6.9-sources.jar"/>

      ... where M2 would be the afore mentioned "workspace path variable" which could be created by "mvn eclipse:add-maven-repo".

      Attachments

        Activity

          People

            Unassigned Unassigned
            wmax Markus Wiederkehr
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: