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

Classpath containing url special characters with Reflections not working

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.16
    • Fix Version/s: 2.20
    • Component/s: classloading
    • Labels:
      None
    • Environment:
      windows 7, RHEL 7

      Description

      When using the maven surefire plugin with unit tests that make use of the CdiRunner (which internally fires up a Weld context) I am facing problems with classpaths that contain characters that need url encoding.

      I have created the following debug output in my test class in the @BeforeClass method:

      System.out.println("----WELD-TEST----");
      System.out.println(ConverterTest.class.getClassLoader().getResource("."));
      System.out.println("----WELD-TEST-END----");
      

      This prints the following output: file:/C:/sources%402/parser/target/test-classes/

      When the tests are launched from IntelliJ the output looks like this: file:/C:/sources@2/parser/target/test-classes/

      Note the @2 versus %402. In the end this causes Reflections (used by Weld) to fail, because it attempts to urlencode the classpath and ends up with file:/C:/sources%25402/parser/target/test-classes/ and gets exceptions when attempting to read files and directories.

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              tibordigana Tibor Digana
              Reporter:
              yanicks90 Yanick Salzmann

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment