diff --git a/Jenkinsfile b/Jenkinsfile index 601ddedd991..162d8a56958 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -227,8 +227,8 @@ pipeline { 'clean install -Pwildfly,postgresql,engine-integration-jakarta', runtimeStash: true, archiveStash: true, - // we need to use JDK 11 for WildFly 27+ - jdkVersion: 'jdk-11-latest') + // we need to use JDK 17 for WildFly 27+ + Spring 6 + jdkVersion: 'jdk-17-latest') }, postFailure: { cambpmPublishTestResult() @@ -515,8 +515,8 @@ pipeline { 'clean install -Pwildfly-domain,h2,engine-integration-jakarta', runtimeStash: true, archiveStash: true, - // we need to use JDK 11 for WildFly 27+ - jdkVersion: 'jdk-11-latest') + // we need to use JDK 17 for WildFly 27+ + Spring 6 + jdkVersion: 'jdk-17 -latest') }, postFailure: { cambpmPublishTestResult() @@ -538,8 +538,8 @@ pipeline { 'clean install -Pwildfly,wildfly-servlet,h2,engine-integration-jakarta', runtimeStash: true, archiveStash: true, - // we need to use JDK 11 for WildFly 27+ - jdkVersion: 'jdk-11-latest') + // we need to use JDK 17 for WildFly 27+ + Spring 6 + jdkVersion: 'jdk-17-latest') }, postFailure: { cambpmPublishTestResult() diff --git a/bom/pom.xml b/bom/pom.xml index 74c4ffd227b..36ccbac5a9b 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -68,6 +68,11 @@ camunda-engine-spring ${project.version} + + org.camunda.bpm + camunda-engine-spring-6 + ${project.version} + org.camunda.bpm camunda-engine-rest diff --git a/distro/wildfly/assembly/pom.xml b/distro/wildfly/assembly/pom.xml index 35b2d20245e..c79a158e2bc 100644 --- a/distro/wildfly/assembly/pom.xml +++ b/distro/wildfly/assembly/pom.xml @@ -54,7 +54,7 @@ org.camunda.bpm - camunda-engine-spring + camunda-engine-spring-6 diff --git a/engine-spring/core-6/pom.xml b/engine-spring/core-6/pom.xml new file mode 100644 index 00000000000..ae5fcd5ce97 --- /dev/null +++ b/engine-spring/core-6/pom.xml @@ -0,0 +1,411 @@ + + 4.0.0 + + Camunda Platform - engine - Spring 6 + camunda-engine-spring-6 + + + org.camunda.bpm + camunda-database-settings + ../../database + 7.20.0-SNAPSHOT + + + + + + + org.camunda.bpm + camunda-core-internal-dependencies + ${project.version} + import + pom + + + + jakarta.platform + jakarta.jakartaee-bom + ${version.jakarta-ee-spec} + pom + import + + + + org.springframework + spring-framework-bom + ${version.spring.framework6} + pom + import + + + + + + + + org.camunda.bpm + camunda-engine + + + org.springframework + spring-context + provided + + + org.springframework + spring-jdbc + provided + + + org.springframework + spring-tx + provided + + + org.springframework + spring-orm + provided + + + org.springframework + spring-web + + provided + + + + + jakarta.servlet + jakarta.servlet-api + provided + + + + org.springframework + spring-test + test + + + junit + junit + test + + + cglib + cglib + test + + + org.codehaus.groovy + groovy-jsr223 + test + + + org.python + jython + test + + + org.graalvm.js + js + test + + + org.graalvm.js + js-scriptengine + test + + + com.h2database + h2 + test + + + org.mockito + mockito-core + test + + + org.assertj + assertj-core + test + + + org.hibernate + hibernate-core-jakarta + 5.6.15.Final + test + + + + org.slf4j + slf4j-api + + + + + ch.qos.logback + logback-classic + test + + + org.slf4j + jcl-over-slf4j + test + + + org.slf4j + jul-to-slf4j + test + + + + org.camunda.bpm + camunda-bpm-archunit + ${project.version} + test + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + sources + generate-sources + + copy-resources + + + ${project.build.directory}/generated-sources/java + + + ${basedir}/../core/src/main/java + false + + + + + + resources + generate-resources + + copy-resources + + + ${project.build.directory}/generated-resources/java + + + ${basedir}/../core/src/main/resources + false + + + + + + test-sources + generate-test-sources + + copy-resources + + + ${project.build.directory}/generated-test-sources/java + + + ${basedir}/../core/src/test/java + false + + **/*NashornTest.java + + + + + + test-resources + generate-test-resources + + copy-resources + + + ${project.build.directory}/generated-test-resources/java + + + ${basedir}/../core/src/test/resources + false + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + initialize + + properties + + + + + + org.eclipse.transformer + transformer-maven-plugin + + + transform-java-sources + generate-sources + + transform + + + ${project.build.directory}/generated-sources/java + + + + transform-resources + generate-resources + + transform + + + ${project.build.directory}/generated-resources/java + + + + transform-java-test-sources + generate-test-sources + + transform + + + ${project.build.directory}/generated-test-sources/java + + + + transform-test-resources + generate-test-resources + + transform + + + ${project.build.directory}/generated-test-resources/java + + + + + + maven-surefire-plugin + + true + + org.camunda.bpm:camunda-bpm-archunit + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + add-java-source + generate-sources + + add-source + + + + ${basedir}/target/generated-sources/java + + + + + add-resources + generate-resources + + add-resource + + + + ${basedir}/target/generated-resources/java + + + + + add-java-test-source + generate-test-sources + + add-test-source + + + + ${basedir}/target/generated-test-sources/java + + + + + add-test-resources + generate-test-resources + + add-test-resource + + + + ${basedir}/target/generated-test-resources/java + + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-java + + enforce + + + + + [17,) + + ***************************************************************************************************** + * * + * You must use at least JDK 17 to build Proces Engine Spring 6 integration!!! * + * * + ***************************************************************************************************** + + + + true + + + + + + + + diff --git a/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/application/SpringProcessApplicationElResolver.java b/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/application/SpringProcessApplicationElResolver.java index 8f79fd54fe1..c8648e9403c 100644 --- a/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/application/SpringProcessApplicationElResolver.java +++ b/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/application/SpringProcessApplicationElResolver.java @@ -22,7 +22,6 @@ import org.camunda.bpm.application.AbstractProcessApplication; import org.camunda.bpm.application.ProcessApplicationElResolver; import org.camunda.bpm.application.impl.EjbProcessApplication; -import org.camunda.bpm.application.impl.ServletProcessApplication; import org.camunda.bpm.engine.spring.ApplicationContextElResolver; import org.camunda.bpm.impl.juel.jakarta.el.ELResolver; import org.springframework.util.ClassUtils; @@ -36,7 +35,7 @@ * @@ -63,8 +62,9 @@ public ELResolver getElResolver(AbstractProcessApplication processApplication) { SpringProcessApplication springProcessApplication = (SpringProcessApplication) processApplication; return new ApplicationContextElResolver(springProcessApplication.getApplicationContext()); - } else if (processApplication instanceof ServletProcessApplication) { - ServletProcessApplication servletProcessApplication = (ServletProcessApplication) processApplication; + } else if (processApplication instanceof org.camunda.bpm.application.impl.ServletProcessApplication) { + // Using fully-qualified class name instead of import statement to allow for automatic transformation + org.camunda.bpm.application.impl.ServletProcessApplication servletProcessApplication = (org.camunda.bpm.application.impl.ServletProcessApplication) processApplication; if(!ClassUtils.isPresent("org.springframework.web.context.support.WebApplicationContextUtils", processApplication.getProcessApplicationClassloader())) { LOGGER.log(Level.FINE, "WebApplicationContextUtils must be present for SpringProcessApplicationElResolver to work"); diff --git a/engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/autodeployment/SpringAutoDeployTest.java b/engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/autodeployment/SpringAutoDeployTest.java index 0bf3b0163d2..aa9c420db8d 100644 --- a/engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/autodeployment/SpringAutoDeployTest.java +++ b/engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/autodeployment/SpringAutoDeployTest.java @@ -18,7 +18,6 @@ import org.camunda.bpm.engine.RepositoryService; import org.camunda.bpm.engine.impl.test.PvmTestCase; -import org.camunda.bpm.engine.impl.util.IoUtil; import org.camunda.bpm.engine.repository.CaseDefinition; import org.camunda.bpm.engine.repository.Deployment; import org.camunda.bpm.engine.repository.DeploymentQuery; @@ -26,11 +25,9 @@ import org.camunda.bpm.engine.repository.ProcessDefinitionQuery; import org.camunda.bpm.model.bpmn.Bpmn; import org.camunda.bpm.model.bpmn.BpmnModelInstance; -import org.springframework.context.ApplicationContext; import org.springframework.context.support.AbstractXmlApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import java.net.URISyntaxException; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -108,7 +105,7 @@ public void testNoRedeploymentForSpringContainerRestart() throws Exception { assertEquals(3, processDefinitionQuery.count()); // Creating a new app context with same resources doesn't lead to more deployments - ((AbstractXmlApplicationContext) applicationContext).destroy(); + ((AbstractXmlApplicationContext) applicationContext).close(); applicationContext = new ClassPathXmlApplicationContext(CTX_PATH); assertEquals(1, deploymentQuery.count()); assertEquals(3, processDefinitionQuery.count()); @@ -148,7 +145,7 @@ public void testDeployChangeOnly() throws Exception { assertEquals(1, repositoryService.createDeploymentQuery().count()); // when - ((AbstractXmlApplicationContext) applicationContext).destroy(); + ((AbstractXmlApplicationContext) applicationContext).close(); DynamicResourceProducer.clearResources(); DynamicResourceProducer.addResource("a.bpmn", model2); @@ -174,7 +171,7 @@ public void testResourceRedeploymentAfterProcessDefinitionChange() throws Except createAppContext(CTX_DYNAMIC_DEPLOY_PATH); assertEquals(1, repositoryService.createDeploymentQuery().count()); - ((AbstractXmlApplicationContext)applicationContext).destroy(); + ((AbstractXmlApplicationContext)applicationContext).close(); // when DynamicResourceProducer.clearResources(); diff --git a/engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/transaction/UserBean.java b/engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/transaction/UserBean.java index b98400a9692..9e967d22b68 100644 --- a/engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/transaction/UserBean.java +++ b/engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/transaction/UserBean.java @@ -16,16 +16,16 @@ */ package org.camunda.bpm.engine.spring.test.transaction; +import static org.junit.Assert.assertEquals; + import javax.sql.DataSource; import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.engine.TaskService; -import org.springframework.beans.factory.annotation.Required; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.assertEquals; - /** * @author Tom Baeyens */ @@ -33,24 +33,24 @@ public class UserBean { /** injected by Spring */ private RuntimeService runtimeService; - + /** injected by Spring */ private TaskService taskService; - + /** injected by Spring */ private DataSource dataSource; @Transactional public void hello() { // here you can do transactional stuff in your domain model - // and it will be combined in the same transaction as + // and it will be combined in the same transaction as // the startProcessInstanceByKey to the Activiti RuntimeService runtimeService.startProcessInstanceByKey("helloProcess"); } - + @Transactional public void completeTask(String taskId) { - + // First insert a record in the MY_TABLE table JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); int results = jdbcTemplate.queryForObject("select count(*) from MY_TABLE", Integer.class); @@ -66,20 +66,20 @@ public void completeTask(String taskId) { } // getters and setters ////////////////////////////////////////////////////// - - @Required + + @Autowired public void setRuntimeService(RuntimeService runtimeService) { this.runtimeService = runtimeService; } - - @Required + + @Autowired public void setTaskService(TaskService taskService) { this.taskService = taskService; } - @Required + @Autowired public void setDataSource(DataSource dataSource) { this.dataSource = dataSource; } - + } diff --git a/engine-spring/pom.xml b/engine-spring/pom.xml index 0c4ea665aa7..d256fa8257e 100644 --- a/engine-spring/pom.xml +++ b/engine-spring/pom.xml @@ -24,5 +24,18 @@ core compatibility-test-spring4 + + + + jdk17 + + [17,) + + + core-6 + + + + diff --git a/parent/pom.xml b/parent/pom.xml index 35a441a8665..662b4bec196 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -20,6 +20,7 @@ 2.16.4.Final 5.3.27 + 6.0.9 2.7.12 3.15.6.Final 2.34 diff --git a/qa/integration-tests-engine-jakarta/pom.xml b/qa/integration-tests-engine-jakarta/pom.xml index 53722f80c55..98334822630 100644 --- a/qa/integration-tests-engine-jakarta/pom.xml +++ b/qa/integration-tests-engine-jakarta/pom.xml @@ -15,6 +15,7 @@ org.wildfly.arquillian 5.0.0.Alpha6 + ${version.spring.framework6} 1.7.0.Alpha13 @@ -141,6 +142,12 @@ jakarta.transaction-api provided + + jakarta.persistence + jakarta.persistence-api + 3.1.0 + test + org.camunda.bpm.javaee @@ -165,6 +172,12 @@ org.camunda.bpm camunda-engine provided + + + spring-beans + org.springframework + + @@ -187,6 +200,19 @@ + + org.camunda.bpm + camunda-engine-spring-6 + ${project.version} + provided + + + camunda-engine + org.camunda.bpm + + + + org.camunda.spin camunda-spin-core @@ -227,6 +253,29 @@ camunda-connect-core + + + org.springframework + spring-context + + + org.springframework + spring-jdbc + + + org.springframework + spring-tx + + + org.springframework + spring-orm + + + org.springframework + spring-web + + org.codehaus.groovy @@ -279,7 +328,7 @@ - **/spring/**/*.java,**/jpa/*.java,**/DeploymentHelper.java + **/DeploymentHelper.java,**/JavascriptScriptEngineSupportNashornTest.java diff --git a/qa/integration-tests-engine-jakarta/src/test/java/org/camunda/bpm/integrationtest/util/DeploymentHelper.java b/qa/integration-tests-engine-jakarta/src/test/java/org/camunda/bpm/integrationtest/util/DeploymentHelper.java index a485d2e4578..d51a2779806 100644 --- a/qa/integration-tests-engine-jakarta/src/test/java/org/camunda/bpm/integrationtest/util/DeploymentHelper.java +++ b/qa/integration-tests-engine-jakarta/src/test/java/org/camunda/bpm/integrationtest/util/DeploymentHelper.java @@ -22,7 +22,7 @@ public class DeploymentHelper extends AbstractDeploymentHelper { protected static final String CAMUNDA_EJB_CLIENT = "org.camunda.bpm.javaee:camunda-ejb-client-jakarta"; protected static final String CAMUNDA_ENGINE_CDI = "org.camunda.bpm:camunda-engine-cdi-jakarta"; - protected static final String CAMUNDA_ENGINE_SPRING = "org.camunda.bpm:camunda-engine-spring"; + protected static final String CAMUNDA_ENGINE_SPRING = "org.camunda.bpm:camunda-engine-spring-6"; public static JavaArchive getEjbClient() { return getEjbClient(CAMUNDA_EJB_CLIENT); diff --git a/qa/pom.xml b/qa/pom.xml index ad04c643593..5da54326e84 100644 --- a/qa/pom.xml +++ b/qa/pom.xml @@ -77,7 +77,6 @@ tomcat-runtime integration-tests-webapps integration-tests-engine - integration-tests-engine-jakarta test-db-util test-db-instance-migration test-db-rolling-update @@ -87,6 +86,16 @@ + + jdk17 + + [17,) + + + integration-tests-engine-jakarta + + + diff --git a/qa/wildfly-runtime/pom.xml b/qa/wildfly-runtime/pom.xml index 8b31a9b03f9..eb7dc29a51a 100644 --- a/qa/wildfly-runtime/pom.xml +++ b/qa/wildfly-runtime/pom.xml @@ -12,6 +12,21 @@ 7.20.0-SNAPSHOT + + + + + org.springframework + spring-beans + ${version.spring.framework6} + + + org.camunda.bpm + camunda-engine + + + +