blaze-persistence icon indicating copy to clipboard operation
blaze-persistence copied to clipboard

Module java.persistence not found, required by com.blazebit.persistence.core.parser

Open dgyg opened this issue 1 year ago • 1 comments

Description

The module-info.java in blaze-persistence-core-api-jakarta-1.6.12.jar declares a dependency on java.persistence

When using jakarta.persistence no dependency on java.persistence should exist anymore.

The error message is:

Module java.persistence not found, required by com.blazebit.persistence.core.parser

Expected behavior

No dependency on java.persistence

Actual behavior

There is a dependency declared:

//  (version 9 : 53.0, no super bit)
 module com.blazebit.persistence.core  {
  // Version: 1.6.12

  requires transitive java.sql;
  requires transitive java.persistence;
  requires java.base;

  exports com.blazebit.persistence;
  exports com.blazebit.persistence.spi;
  exports com.blazebit.persistence.internal;

  uses com.blazebit.persistence.spi.CriteriaBuilderConfigurationProvider

}

Steps to reproduce

pom.xml with

<dependency>
    <groupId>com.blazebit</groupId>
    <artifactId>blaze-persistence-core-api-jakarta</artifactId>
    <version>1.6.12</version>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>com.blazebit</groupId>
    <artifactId>blaze-persistence-core-impl-jakarta</artifactId>
    <version>1.6.12</version>
    <scope>runtime</scope>
</dependency>
<dependency>
    <groupId>com.blazebit</groupId>
    <artifactId>blaze-persistence-integration-hibernate-6.2</artifactId>
    <version>1.6.12</version>
    <scope>runtime</scope>
</dependency>

Environment

Version: 1.6.12
JPA-Provider: Hibernate 6.5.3.Final

dgyg avatar Oct 05 '24 11:10 dgyg

Indeed, this is a problem of the jakarta modules since the module-info.java files are not rewritten by the Eclipse Transformer plugin.

beikov avatar Oct 07 '24 08:10 beikov

Is JPMS even useful in Hibernate projects? In my last attempts Hibernate still had so many dependencies in the auto module that I couldn't get jlink to work, and while the idea of reduced binary size in containerised environments seemed promising to me, there really seems no other reason to me to use JPMS?

(Addressing the label worth: high here)

jwgmeligmeyling avatar Dec 12 '24 18:12 jwgmeligmeyling

Fyi, I switched to Java 11 for 2.0 and also reworked all the module-info files, so these issues should be gone in 2.0.

beikov avatar Dec 13 '24 09:12 beikov