Skip to content

Commit

Permalink
Make the CDI/interceptor dependencies optional in module-info
Browse files Browse the repository at this point in the history
The "static" keyword means "required for compilation of this module, but
not at runtime", which is pretty much the current situation.

Those dependencies are only required for the @transactional
and @TransactionScoped annotations,
but jakarta.transaction can perfectly well be used without CDI, e.g. in
Hibernate ORM in a Java SE environment.

Without this change, it's impossible to use jakarta.transaction-api (or
anything relying on it, e.g. Hibernate ORM) without CDI in the
modulepath.

Signed-off-by: Yoann Rodière <[email protected]>
  • Loading branch information
yrodiere committed Jan 31, 2023
1 parent b394eb9 commit fbfabcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module jakarta.transaction {
requires java.rmi;
requires transitive java.transaction.xa;
requires transitive jakarta.cdi;
requires jakarta.interceptor;
requires static transitive jakarta.cdi;
requires static jakarta.interceptor;

exports jakarta.transaction;
}

0 comments on commit fbfabcf

Please sign in to comment.