transactions
transactions copied to clipboard
Make the CDI/interceptor dependencies optional in module-info
Fixes #214
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-api 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.
Can one of the admins verify this patch?
FWIW I'm a Red Hat employee and thus covered by Red Hat's Eclipse Contributor Agreement, and that's visible on my Eclipse profile, so I don't know why the automated check on GitHub fails.
EDIT: The problem was a trailing space in the "First name" field in my Eclipse profile :facepalm:
Is the intention for this to be a service release of the API jar for EE10 or is would it be required to wait for EE11?
Is the intention for this to be a service release of the API jar for EE10 or is would it be required to wait for EE11?
From my point of view this is essentially a bugfix. As far as I'm concerned, this would need to be included in a bugfix release in EE10 (e.g. jakarta.transaction-api
2.0.2
).
In my opinion there's also no need to wait for EE11, because this change shouldn't break any application. As I understand it, users either are not using CDI and then removing the dependency won't affect them negatively, or they are using CDI and then all the related modules are already in their modulepath and will continue to be exposed to users transitively through this module-info.
However, I am not familiar with the Jakarta release process at all. Maybe it's too late for such change in EE10? You probably know better than I do.
Thank you for the clarification
ok to test
Hey. It looks like the build got stuck or was aborted for some reason... can anyone restart it?
retest this please
The testing infra seems to be having problems:
[ERROR] Error executing Maven. [ERROR] The specified user settings file does not exist: /home/jenkins/agent/workspace/eclipse-ee4j_jta-api-pulls-openjdk-jdk11-latest/glassfish/snapshots/settings.xml Build step 'Execute shell' marked build as failure
retest this please
I have commented out a line of the build config mvn -s ./snapshots/settings.xml clean install -f ./snapshots/pom.xml
- snapshots/
folder is not in the current glassfish master
branch.
[ERROR] Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
Detected Maven Version: 3.8.5 is not in the allowed range 3.8.6.
:)
retest this please
Thanks, the job was configured to use apache-maven-latest
but maybe this is not updated yet to point to a version that would satisfy the check. I found apache-maven-3.8.6 in the list though and so have configured it to be that
Thank you for working on this :)
Next one...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:3.1.0:run (do stuff) on project glassfish: An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] /home/jenkins/agent/workspace/eclipse-ee4j_jta-api-pulls-openjdk-jdk11-latest/glassfish/appserver/distributions/glassfish/target/antrun/build-main.xml:9: The archive microprofile-jwt-auth-api.jar doesn't exist
[ERROR] around Ant part ...<jarupdate basedir="/home/jenkins/agent/workspace/eclipse-ee4j_jta-api-pulls-openjdk-jdk11-latest/glassfish/appserver/distributions/glassfish/src/main/patches/microprofile-jwt-auth-api" destfile="/home/jenkins/agent/workspace/eclipse-ee4j_jta-api-pulls-openjdk-jdk11-latest/glassfish/appserver/distributions/glassfish/target/stage/glassfish7/glassfish/modules/microprofile-jwt-auth-api.jar" includes="META-INF/MANIFEST.MF" />... @ 17:430 in /home/jenkins/agent/workspace/eclipse-ee4j_jta-api-pulls-openjdk-jdk11-latest/glassfish/appserver/distributions/glassfish/target/antrun/build-main.xml
You are welcome :)
I wonder if Glassfish is building fine on their main branch now. I will try to have a look.
The reason we use Glassfish is to run the CTS with changes to make sure nothing is unexpectedly breaking.
I have a feeling this might affect the current master
branch of Glassfish. The most recent weekly build did pass (https://ci.eclipse.org/glassfish/view/GlassFish/job/glassfish_weekly_build/171/) but there are changes in Glassfish since 93176e2555176091c8522e43d1d32a0a30652d4a
I am not sure why those approvals were just provided from those accounts. I don't think they are committers though: https://projects.eclipse.org/projects/ee4j.jta/who
I am not sure why those approvals were just provided from those accounts. I don't think they are committers though: https://projects.eclipse.org/projects/ee4j.jta/who
Sorry Tom. We approved it because our team/project ran into exactly the same issue. Having these requires as static would solve these issues for us. We just upgraded our project from Spring boot 2 > 3 (which requires an javax > jakarta upgrade), but due to that upgrade, we were required to add a dependency on jakarta cdi as well (due to reason Yoann posted here).
We would've prefered a thumbs up / vote as it seemed this PR was a bit forgotten, but that wasn't possible. So we wanted to raise some awareness of this PR again. Although we're not familiar with the Jakarta release process, so this might still have been on the radar though.
Ah, great - thank you for clarifying!
Hello @tomjenkinson! Is there something I can help with to get this merged?
Hey @tomjenkinson , is there any chance to get this merged?
retest this please
@yrodiere I have requested CI to retest this, thanks
Looks like it's failing due to some Maven incompatibility:
+ mvn -Pstaging clean install -Djakarta.transaction-api.version=2.0.2-SNAPSHOT -DskipTests
[INFO] Scanning for projects...
[WARNING] Error injecting: org.glassfish.build.GlassFishJarLifecycle
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, java.lang.NoSuchMethodError: org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping.<init>(Ljava/util/List;)V
at org.glassfish.build.GlassFishJarLifecycle.<init>(Unknown Source)
while locating org.glassfish.build.GlassFishJarLifecycle
1 error
at com.google.inject.internal.InternalProvisionException.toProvisionException (InternalProvisionException.java:226)
FWIW Glassfish's main branch requires Maven 3.9: https://github.com/eclipse-ee4j/glassfish/blob/c6ee22af21e2578f745a516a251c0c662124b178/pom.xml#L78-L90
Thank you, I have changed the configuration to use something that looked like it should expect to be latest. Will retry the build.
retest this please
retest this please
There was something failing in JWT. I found a SHA in CI of something I hope to pass. It might need JDK upgrade though to 17 as the job is currently using JDK 11.
I am trying a build locally. I tried a few versions of a build earlier but couldn't get the build to fail for a missing microprofile-jwt-auth-api.jar
but I am using the same SHA now. Also with 78a3424568a59097da7c6479c74cb7ccc42a749e it does seems to be at least getting the build started with JDK 11