You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Sachin Patel <sp...@gmail.com> on 2005/06/29 20:13:49 UTC

Patch for maven m:eclipse command

For those wanting to use Eclipse as the IDE for Geronimo development, 
with the current supported version of Maven for Geronimo, there is a bug 
that prevents correct .classpath entries to be generated for some of the 
projects (specifically those ending in "-builder").

This problem has been resolved in the 1.1 beta 2 version of Maven.

http://jira.codehaus.org/browse/MAVEN-1520

However, until that version of Maven can be used, you can modify the
eclipse plugin itself with the described changes to fix the issue.

In the MAVEN_INSTALL/plugins/maven-eclipse-plugin-1.9.jar open the 
classpath.jelly file and change the following segment from....

<!-- add extra directories to be included in the classpath -->
   <j:forEach var="res" items="${maven.eclipse.classpath.include.split}">
     <maven:makeRelativePath var="srcDir" basedir="${basedir}" 
path="${res}"  separator="/"/>
     <classpathentry kind="src" path="${srcDir}"/>
   </j:forEach>

to the following...

   <!-- add extra directories to be included in the classpath -->
   <j:forEach var="res" items="${maven.eclipse.classpath.include.split}">
     <!-- PATCH -->
     <j:set var="srcDir" value="${res}" />
     <j:if test="${res.startsWith(basedir)}">
       <maven:makeRelativePath var="srcDir" basedir="${basedir}" 
path="${res}"  separator="/"/>
     </j:if>
     <classpathentry kind="src" path="${srcDir}"/>
   </j:forEach>

Afterwards repackage the jar, and simply rerun the maven -o m:eclipse 
command and the problem .classpath files will be corrected.