Maven project executes tests on class path with JDK 25

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Tested on Windows x64, Windows ARM, and Linux x64

      A DESCRIPTION OF THE PROBLEM :
      In my open-source project I make massive use of the Java Platform Module System (JPMS) and ServiceLoader and declare my services in module-info.java.
      In order to make use of ScopedValue I had to upgrade to Java 25.
      However, this breaks all my tests with errors like this:

      Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalStateException: Required at least 1 service(s) for java.util.ServiceLoader[io.github.mmm.bean.BeanFactory] [in thread "main"]
              at io.github.mmm.base.service.ServiceHelper.all(ServiceHelper.java:126)
              at io.github.mmm.base.service.ServiceHelper.all(ServiceHelper.java:108)
              at io.github.mmm.bean.impl.BeanFactoryManager.<init>(BeanFactoryManager.java:30)
              at io.github.mmm.bean.impl.BeanFactoryManager.<clinit>(BeanFactoryManager.java:21)
              at io.github.mmm.bean.BeanFactory.get(BeanFactory.java:54)
              at io.github.mmm.orm.statement.City.of(City.java:30)
              at io.github.mmm.orm.mapping.OrmTest.testMapCity(OrmTest.java:43)
              ... 3 more

      Even if I add "require" statements for all modules otherwise required indirectly (via "requires transitive"), the error remains. IMHO the ServiceLoader was broken in Java25 in combination with JPMS and there is no regression test for it in the JDK.



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      mvn clean install


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Build success
      ACTUAL -
      Build failed

      ---------- BEGIN SOURCE ----------
      See the attachment
      ---------- END SOURCE ----------

        1. jdk-bugs.zip
          14 kB
        2. maven.log.txt
          9 kB
        3. pom.xml
          1 kB

            Assignee:
            Christian Stein
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: