jakartaee / enterprise-beans

Jakarta Enterprise Beans
https://eclipse.org/ee4j/ejb
Other
19 stars 29 forks source link

Upgrade jakarta.transaction-api from 2.0.0 to 2.0.1 #147

Open chengfang opened 1 year ago

chengfang commented 1 year ago

jakarta.transaction-api 2.0.1 is the version included in Jakarta EE 10:

diff between 2.0.0 and 2.0.1: https://github.com/jakartaee/transactions/compare/2.0.0...2.0.1 tag: https://github.com/jakartaee/transactions/releases/tag/2.0.1

But after bumping to jakarta.transaction-api 2.0.1, ejb-api fails to build:

[INFO] --- maven-compiler-plugin:3.8.1:compile (compile-module-info) @ jakarta.ejb-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/cfang/dev/spec/enterprise-beans/api/target/classes
[parsing started SimpleFileObject[/Users/cfang/dev/spec/enterprise-beans/api/src/main/java/module-info.java]]
[parsing completed 15ms]
[loading /9-modules/java.rmi/module-info.sig]
[loading /9-modules/java.base/module-info.sig]
[loading /9-modules/java.logging/module-info.sig]
[loading /9-modules/java.naming/module-info.sig]
[loading /9-modules/java.security.sasl/module-info.sig]
[loading /Users/cfang/.m2/repository/jakarta/transaction/jakarta.transaction-api/2.0.1/jakarta.transaction-api-2.0.1.jar(/module-info.class)]
[total 89ms]
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] module not found: jakarta.cdi
[ERROR] module not found: java.transaction.xa
[INFO] 2 errors

jakarta.ejb module has a requires transitive on jakarta.transaction-api, which in turn has requires transitive on jakarta.cdi and java.transaction.xa. These 2 modules are not found by javac.

Changing requires transitive to requires in ejb does not help and it still fails with the same errors. But if I instead remove transitive from jakarta.transaction-api module, I was able to build ejb with the modified transaction-api. This is just an experiment and may not be the solution.

ejb-api only references the TransactionManager class from transaction-api, but the above chain of requires imposes some extra dependencies on ejb-api, and maybe some other consumer projects. So this may be something to consider for transaction-api project.