Maven 1.x Eclipse Plugin
  1. Maven 1.x Eclipse Plugin
  2. MPECLIPSE-92

Setting relative path value to "maven.eclipse.output.dir" generates wrong absolute classpath entry

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.10
    • Labels:
      None
    • Number of attachments :
      0

      Description

      In a J2EE project environment, the master project is "sample-project", the web project is "sample-project-web"

      If set the property
      maven.eclipse.output.dir=web-content/WEB-INF/classes
      in the sample-project-web project

      The result .classpath created by the Eclipse plugin has the following entry:

      <classpathentry kind="output" path="C:/maven_projects/sample-project/web-content/WEB-INF/classes">
      </classpathentry>

      This is wrong. The path value should be a relative path.

      Solution:

      change the following line in the classpath.jelly

      from:

      <j:set var="outputDir" value="$

      {maven.eclipse.output.dir}"/>
      <j:if test="${empty outputDir}">
      <j:set var="outputDir" value="${maven.build.dest}"/>
      </j:if>
      <maven:makeRelativePath var="outputDir" basedir="${basedir}" path="${outputDir}" separator="/"/>
      <classpathentry kind="output" path="${outputDir}"/>
      <ant:echo>Setting default output directory to ${outputDir}</ant:echo>

      to

      <j:set var="outputDir" value="${maven.eclipse.output.dir}

      "/>
      <j:if test="$

      {empty outputDir}

      ">
      <j:set var="outputDir" value="$

      {maven.build.dest}

      "/>
      <maven:makeRelativePath var="outputDir" basedir="$

      {basedir}

      " path="$

      {outputDir}" separator="/"/>
      </j:if>
      <classpathentry kind="output" path="${outputDir}

      "/>
      <ant:echo>Setting default output directory to $

      {outputDir}

      </ant:echo>

      With a requirement that the maven.eclipse.output.dir should always be set as a relative path. This requirement should be put in the plugin properties doc.

        Activity

        Hide
        fabrizio giustina added a comment -

        fixed in svn

        Show
        fabrizio giustina added a comment - fixed in svn

          People

          • Assignee:
            fabrizio giustina
            Reporter:
            Yang Li
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: