Maven 1.x Eclipse Plugin

plugin:test broken in 1.11

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.11
  • Fix Version/s: 1.12
  • Component/s: None
  • Labels:
    None
  • Environment:
    m11b3
  • Number of attachments :
    0

Description

The test test-classpath-has-overridden-jar in src/plugin-test/maintest/maven.xml fails. For some reason, the string MAVEN_REPO/maven/jars/maven.jar is replaced by $MAVEN_HOME/lib/maven.jar. If this is intentional, the test should be rewritten.

Activity

Hide
Arnaud Heritier added a comment -

This is because the maven.jar dependency is now overriden in all plugins (in plugins-parent) which was not the case before (only defined in some plugins)

Show
Arnaud Heritier added a comment - This is because the maven.jar dependency is now overriden in all plugins (in plugins-parent) which was not the case before (only defined in some plugins)
Hide
Stephane Nicoll added a comment -

Ouh ouh ; Classpath.jelly requests the cactus dependency of the maven plugin so it's really nasty to test on that (if you have another cactus plugin, it might break).

Show
Stephane Nicoll added a comment - Ouh ouh ; Classpath.jelly requests the cactus dependency of the maven plugin so it's really nasty to test on that (if you have another cactus plugin, it might break).
Hide
Stephane Nicoll added a comment -

Lukas, can you help?

I've "fixed" the cactus dependency problem but we need to investigate. The current cactus dependency is 13-1.6.1 but the cactus plugin expected 13-1.7. I tried to retrieve the version from the plugin to automate this but it does not work so I changed it this way

<echo>Warning, expecting cactus version 13.1-7 from current cactus plugin</echo>
<x:set var="countCactus" select="count($classpathDoc/classpath/classpathentry[contains(@path,'MAVEN_REPO/cactus/jars/cactus-13-1.7.jar')])"/>

Further on, the plugin breaks and I think we have a bug

<classpathentry excluding="" including="" kind="src" path="src/test">
  </classpathentry>
  <classpathentry output="target/test-classes" kind="src" path="src/test">
  </classpathentry>

To me, this entry is duplicated right?

Show
Stephane Nicoll added a comment - Lukas, can you help? I've "fixed" the cactus dependency problem but we need to investigate. The current cactus dependency is 13-1.6.1 but the cactus plugin expected 13-1.7. I tried to retrieve the version from the plugin to automate this but it does not work so I changed it this way
<echo>Warning, expecting cactus version 13.1-7 from current cactus plugin</echo>
<x:set var="countCactus" select="count($classpathDoc/classpath/classpathentry[contains(@path,'MAVEN_REPO/cactus/jars/cactus-13-1.7.jar')])"/>
Further on, the plugin breaks and I think we have a bug
<classpathentry excluding="" including="" kind="src" path="src/test">
  </classpathentry>
  <classpathentry output="target/test-classes" kind="src" path="src/test">
  </classpathentry>
To me, this entry is duplicated right?
Hide
Stephane Nicoll added a comment -

The error is here

<!-- don't add duplicate directories -->
          <j:if
            test="${resourceDirectoryFile.exists() and !resourceDirectory.equals(srcDir) and (!resourceDirectory.equals(testSrcDir) or !unitTestSourcesPresent)}">
            <classpathentry kind="src" path="${resourceDirectory}" including="${includingAsString}"
              excluding="${excludingAsString}" />
          </j:if>
Show
Stephane Nicoll added a comment - The error is here
<!-- don't add duplicate directories -->
          <j:if
            test="${resourceDirectoryFile.exists() and !resourceDirectory.equals(srcDir) and (!resourceDirectory.equals(testSrcDir) or !unitTestSourcesPresent)}">
            <classpathentry kind="src" path="${resourceDirectory}" including="${includingAsString}"
              excluding="${excludingAsString}" />
          </j:if>
Hide
Stephane Nicoll added a comment -

mmm weird. I think the jelly test is not working as expected:

    [echo] resourceDirectoryFile.exists(): true
    [echo] resourceDirectory.equals(srcdir): false
    [echo] resourceDirectory.equals(testSrcDir): false
    [echo] unitTestSourcesPresent: true
    [echo] Will add entry for src/test
    [echo] Contains JUnit tests
    [echo] Setting compile of src/test to target/test-classes

should be a 'and' I guess for the last test

Show
Stephane Nicoll added a comment - mmm weird. I think the jelly test is not working as expected:
    [echo] resourceDirectoryFile.exists(): true
    [echo] resourceDirectory.equals(srcdir): false
    [echo] resourceDirectory.equals(testSrcDir): false
    [echo] unitTestSourcesPresent: true
    [echo] Will add entry for src/test
    [echo] Contains JUnit tests
    [echo] Setting compile of src/test to target/test-classes
should be a 'and' I guess for the last test
Hide
Stephane Nicoll added a comment -

Ok found it, cactus was reseting the testSrcDir to a wrong value.

Show
Stephane Nicoll added a comment - Ok found it, cactus was reseting the testSrcDir to a wrong value.
Hide
Stephane Nicoll added a comment -

This is fixed, execpt the cactus dependency thingy.

Show
Stephane Nicoll added a comment - This is fixed, execpt the cactus dependency thingy.
Hide
Lukas Theussl added a comment -

It's not fixed for me, plugin:test still fails for the same reason that I stated above. (I never noticed the cactus problem as I never used cactus and don't have it installed.) I can fix it easily but I don't know what is actually the expected entry in .classpath, is it

<classpathentry kind="lib" path="MAVEN_REPO/maven/jars/maven.jar"></classpathentry>

or is it

<classpathentry kind="lib" path="${MAVEN_HOME}/lib/maven.jar"></classpathentry>
?

Show
Lukas Theussl added a comment - It's not fixed for me, plugin:test still fails for the same reason that I stated above. (I never noticed the cactus problem as I never used cactus and don't have it installed.) I can fix it easily but I don't know what is actually the expected entry in .classpath, is it <classpathentry kind="lib" path="MAVEN_REPO/maven/jars/maven.jar"></classpathentry> or is it <classpathentry kind="lib" path="${MAVEN_HOME}/lib/maven.jar"></classpathentry> ?
Hide
Stephane Nicoll added a comment -

Well. I did not have to change anything for me, it worked in a first place.

Expected entry is 'MAVEN_REPO/maven/jars/maven.jar'

Show
Stephane Nicoll added a comment - Well. I did not have to change anything for me, it worked in a first place. Expected entry is 'MAVEN_REPO/maven/jars/maven.jar'
Hide
Lukas Theussl added a comment -

Fixed. We now check for both classpathentries, at least one of them has to be present.

Show
Lukas Theussl added a comment - Fixed. We now check for both classpathentries, at least one of them has to be present.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: