You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ji...@codehaus.org on 2004/06/03 08:22:04 UTC

[jira] Commented: (MPECLIPSE-13) Two hacks to the eclipse plug-in in .classpath generation (see comments for details)

The following comment has been added to this issue:

     Author: Pål Brattberg
    Created: Thu, 3 Jun 2004 2:21 AM
       Body:
Jens, I too needed what you was asking for, and here is my attempt.

Notice that support for exclusion patterns in not on by default in Eclipse, at least not in IBM WSAD (which in turn is derived from Eclipse). So, if you do not have exclusion support on, and you have exclude patterns in your project.xml file, Eclipse will complain about your new .classpath file. Either comment the piece in my addition that adds exclusions, or tell Eclipse to support exclusion.

This code should go in MAVEN_HOME/plugins/maven-eclipse-plugin-1.7/plugin-resources/templates/classpath.jelly. I added it right after the first <classpath> entry.

  <j:if test="${!pom.build.resources.isEmpty()}"> 
    <j:forEach var="res" items="${pom.build.resources}"> 
      <maven:makeRelativePath var="srcDir" basedir="${basedir}" path="${res.directory}"/>
        <!-- Comment this if you do not wish to use exclusions for resources. 
             Note that _includes_ do not yet work in Eclipse (AFAIK), so beware of that
             if things seem to crash. Also make sure your project is prepared for exclusions,
             this can be set as a property for the compiler. -->
        <j:set var="excluding" value=""/>
        <j:forEach var="exclude" items="${res.excludes}">
          <j:choose>
            <j:when test="${excluding.length() == 0}">
              <j:set var="excluding" value="${exclude}"/>
            </j:when>
            <j:otherwise>
              <j:set var="excluding" value="${excluding},${exclude}"/>
            </j:otherwise>
          </j:choose>
        </j:forEach>
        <!-- End exclusion patterns -->
      <classpathentry kind="src" path="${srcDir}" excluding="${excluding}" /> 
    </j:forEach> 
  </j:if> 
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/MPECLIPSE-13?page=comments#action_20300

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPECLIPSE-13

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPECLIPSE-13
    Summary: Two hacks to the eclipse plug-in in .classpath generation (see comments for details)
       Type: Improvement

     Status: Unassigned
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-eclipse-plugin

   Assignee: 
   Reporter: Diego Fernandez

    Created: Wed, 16 Apr 2003 3:00 PM
    Updated: Thu, 3 Jun 2004 2:21 AM

Description:
The attached file contains two hacks to the generation of the classpath in the eclipse:generate-classpath plug-in:
1. Added the source directory for the integration unit tests.
(TODO: add cactus JARs to the classpath)
2. Add JARs only once (using a Set), this is useful when you have a junit in the dependencies (or may be in the future when you have the cactus libs)


---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org