Maven 1.x Test Plugin
  1. Maven 1.x Test Plugin
  2. MPTEST-49

test:test does not allow multiple source directories

    Details

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

      Description

      Our project is set up as follows:
      src/main/java
      src/main/resources
      src/tests/java
      src/tests/resources

      Some of the files in src/tests/resources are xml files which are used to generate JUnit source files. These are generated into

      target/testutil

      This value is set in our properties file as
      maven.clienttester.src.dir = $

      {maven.build.dir}

      /testutil

      <ant:path id="testutil.src.dir" location="$

      {maven.clienttester.src.dir}

      "/>
      <maven:addPath id="maven.test.compile.src.set" id="testutil.src.dir"/>

      Now, calling the test:compile goal will compile the source files from target/testutil into target/test-classes

      This is good.
      However, test:test doesn't attempt to run any of these test files. test:test only runs the files located in src/tests/java, as defined in my project.xml file.

      This is not so good. Since I have source files for everything, I would prefer not to use maven.test.search.classdir property. test:test should honour the maven.test.compile.src.set variable, the same as test:compile.

        Activity

        Hide
        Arnaud Heritier added a comment -

        The proposed fix creates this error on windows :

        File...... file:/d:/Data/maven-1/cache/maven-test-plugin-1.8-SNAPSHOT/plugin.jelly
        Element... junit
        Line...... 151
        Column.... -1
        D:\OSS\Maven\1.X\SCM\plugins\trunk\artifact\D not found.

        This is because the path separator is hardcoded with a character ':' which is used in the drive letter.

        Show
        Arnaud Heritier added a comment - The proposed fix creates this error on windows : File...... file:/d:/Data/maven-1/cache/maven-test-plugin-1.8-SNAPSHOT/plugin.jelly Element... junit Line...... 151 Column.... -1 D:\OSS\Maven\1.X\SCM\plugins\trunk\artifact\D not found. This is because the path separator is hardcoded with a character ':' which is used in the drive letter.
        Hide
        Arnaud Heritier added a comment -

        Lukas, can you test it on linux and close this issue if it works.
        thx.

        Show
        Arnaud Heritier added a comment - Lukas, can you test it on linux and close this issue if it works. thx.
        Hide
        Lukas Theussl added a comment -

        Works. Thanks!

        Show
        Lukas Theussl added a comment - Works. Thanks!
        Hide
        Jeff Jensen added a comment -

        Fantastic find and fix.

        Is this published in a snapshot? The latest 1.8-SNAPSHOT I find is on http://cvs.apache.org/repository/maven/plugins and has a date of: 26-Mar-2006 11:42, which appears after the fix date.

        Using that published snapshot, I still have this problem.

        Am I missing a repo where the current snapshot is published? (I thought the core plugins were auto-snapshot-ted?) I greatly prefer using the published snapshots over build-my-own for the impact on the team...

        Show
        Jeff Jensen added a comment - Fantastic find and fix. Is this published in a snapshot? The latest 1.8-SNAPSHOT I find is on http://cvs.apache.org/repository/maven/plugins and has a date of: 26-Mar-2006 11:42, which appears after the fix date. Using that published snapshot, I still have this problem. Am I missing a repo where the current snapshot is published? (I thought the core plugins were auto-snapshot-ted?) I greatly prefer using the published snapshots over build-my-own for the impact on the team...
        Hide
        Lukas Theussl added a comment -

        Does that mean that it works if you use a self-built version from SVN but not with the published snapshot? The above snapshot should indeed include this fix, if not, I have just republished it, can you try again?

        Show
        Lukas Theussl added a comment - Does that mean that it works if you use a self-built version from SVN but not with the published snapshot? The above snapshot should indeed include this fix, if not, I have just republished it, can you try again?
        Hide
        Jeff Jensen added a comment -

        Yes! That snapshot now works! Thank you very much for republishing so immediately.

        Show
        Jeff Jensen added a comment - Yes! That snapshot now works! Thank you very much for republishing so immediately.

          People

          • Assignee:
            Lukas Theussl
            Reporter:
            Nick Matthews
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: