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

Startup exception ClassNotFoundException of StartupReportConfiguration with module-info.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Works for Me
    • 2.22.2, 3.0.0-M3
    • None
    • None

    Description

      As surefire-plugin is starting up during the build it crashes out with a series of exceptions.  The junit tests are not performed.  Tracing through the attached build.out.txt (see attachments) suggests the ClassNotFoundException  is a result of a SurefireReflectionException.   Not sure if my interpretation is  accurate.

      This started occurring on my application upon migrating from JDK8 to JDK12.  I have a purpose for their 'jlink' tool.  JDK12 is the target delivery vehicle. 

      A project zip is attached that contains one Main.class and files required to build it.   It is a dirt simple reproduction of my problem.  

      I am hoping that someone on the surefire team can unzip it and try to reproduce my issue.

      If the <skipTests> flag is set to true, the little toy executable will actually build up and can be executed on the command line.   Proves that JDK is able to handle its modules correctly.   It can be run by unzipping the distribution assembly and run with the command ...

      cd target; unzip SurefireStartupIssue-dist.zip; cd SurefireStartupIssue

      java --module-path '.;lib' -m SurefireStartupIssue/com.samplebiz.surefirestartupissue.Main

       

      Crude workaround (temporarily disable Java Modules):

      1. Rename your ‘module-info.java’ file <tempfile>.
      2. Make surefire configuration has <skipTests>false</skipTests>
      3. Run tests… all should pass.
      4. When done with tests, restore ‘module-info.java to enable Java modules.

       

      Attachments

        1. build.out.txt
          13 kB
          Roy Williams
        2. SurefireStartupIssue.zip
          11 kB
          Roy Williams

        Activity

          People

            tibordigana Tibor Digana
            roy_williams Roy Williams
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: