Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-638

Plugin cannot handle "java" in a path name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.4.3, 2.5, 2.6
    • 2.7
    • Maven Surefire Plugin
    • None

    Description

      See SUREFIRE-536
      ================

      Commons SCXML had the following include:

      <include>org/apache/commons/scxml/env/javascript/EnvJavaScriptTestSuite.java</include>

      However, the suite was not being found and executed.

      A bit of experimentation showed that the problem is the string "java" in the pathname.

      A work-round is to use:

      <include>org/apache/commons/scxml/env/j*avascript/EnvJavaScriptTestSuite.java</include>
      or
      <include>org/apache/commons/scxml/env/jav*ascript/EnvJavaScriptTestSuite.java</include>
      or
      <include>org/apache/commons/scxml/env/*/EnvJavaScriptTestSuite.java</include>
      etc.

      This appears to be due to the following code in SurefireDirectoryScanner.processIncludesExcludes():

      incs[i] = StringUtils.replace( (String) list.get( i ), "java", "class" );

      Changing this to

      incs[i] = StringUtils.replace( (String) list.get( i ), ".java", ".class" );

      would be better than nothing, however that would still fail on a directory name that contains ".java" (perhaps not very likely).

      What is really needed is to only replace the ".java" if it appears at the end of the string.

      Attachments

        1. org.apache.maven.surefire.surefire-SUREFIRE-638.patch
          4 kB
          Stevo Slavić
        2. surefire-638.zip
          3 kB
          sebbasf

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sebb Sebb
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: