Remove absolute paths from .project and .classpath in PDE mode
--------------------------------------------------------------
Key: MECLIPSE-247
URL: http://jira.codehaus.org/browse/MECLIPSE-247
Project: Maven 2.x Eclipse Plugin
Issue Type: Improvement
Components: PDE support
Affects Versions: 2.3
Reporter: Markus Wiederkehr
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".
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira