Skip to content

Commit

Permalink
chore(project): move the source code level to Java 11 (camunda#3691)
Browse files Browse the repository at this point in the history
* bump to 2.3.0 bpm-release-parent to adopt source code level change and plugin updates
* ci: introduce default jdk version set to jdk-11
* remove jdk 8 profiles and update jdk 11 profiles
* remove dependencies needed for jdk8 building
* engine manifest: remove additional version in osgi export packages
* qa: update arquillian-tomcat dependencies compatible with jdk 11
* migration tests: bump h2 to 1.4.200 version compatible with jdk 11
* update readmes

camunda#3690
  • Loading branch information
yanavasileva authored Sep 18, 2023
1 parent 2a6579e commit 4c65ada
Show file tree
Hide file tree
Showing 24 changed files with 161 additions and 293 deletions.
1 change: 1 addition & 0 deletions .ci/daily/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pipeline {
environment {
LOGGER_LOG_LEVEL = 'DEBUG'
MAVEN_VERSION = 'maven-3.8-latest'
DEF_JDK_VERSION = 'jdk-11-latest'
}
parameters {
booleanParam name: 'TRIGGERED_BY_UPSTREAM', defaultValue: false, description: 'Is the current build triggered in the scope of an upstream pipeline (pull request or default branch)'
Expand Down
1 change: 1 addition & 0 deletions .ci/main-trigger/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pipeline {
environment {
LOGGER_LOG_LEVEL = 'DEBUG'
MAVEN_VERSION = 'maven-3.8-latest'
DEF_JDK_VERSION = 'jdk-11-latest'
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
Expand Down
1 change: 1 addition & 0 deletions .ci/sidetrack/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pipeline {
environment {
LOGGER_LOG_LEVEL = 'DEBUG'
MAVEN_VERSION = 'maven-3.8-latest'
DEF_JDK_VERSION = 'jdk-11-latest'
}
parameters {
booleanParam name: 'TRIGGERED_BY_UPSTREAM', defaultValue: false, description: 'Is the current build triggered in the scope of an upstream pipeline (pull request or default branch)'
Expand Down
15 changes: 7 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pipeline {
environment {
LOGGER_LOG_LEVEL = 'DEBUG'
MAVEN_VERSION = 'maven-3.8-latest'
DEF_JDK_VERSION = 'jdk-11-latest'
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
Expand Down Expand Up @@ -50,7 +51,7 @@ pipeline {
withCatch: false,
withNpm: true,
// we use JDK 17 to build the artifacts, as it is required for supporting Spring Boot 3
// the compiler source and target is set to JDK 8 in the release parents
// the compiler source and target is set to JDK 11 in the release parents
jdkVersion: 'jdk-17-latest')
}

Expand Down Expand Up @@ -227,7 +228,7 @@ pipeline {
'clean install -Pwildfly,postgresql,engine-integration-jakarta',
runtimeStash: true,
archiveStash: true,
// we need to use JDK 17 for WildFly 27+ + Spring 6
// we need to use JDK 17 for Spring 6
jdkVersion: 'jdk-17-latest')
},
postFailure: {
Expand Down Expand Up @@ -272,7 +273,7 @@ pipeline {
'clean install -Pwildfly,postgresql,postgresql-xa,engine-integration-jakarta',
runtimeStash: true,
archiveStash: true,
// we need to use JDK 17 for WildFly 27+ + Spring 6
// we need to use JDK 17 for Spring 6
jdkVersion: 'jdk-17-latest')
},
postFailure: {
Expand Down Expand Up @@ -333,9 +334,7 @@ pipeline {
cambpmRunMaven('qa/',
'clean install -Pwildfly,h2,webapps-integration',
runtimeStash: true,
archiveStash: true,
// we need to use JDK 11 for WildFly 27+
jdkVersion: 'jdk-11-latest')
archiveStash: true)
},
postFailure: {
cambpmPublishTestResult()
Expand Down Expand Up @@ -495,7 +494,7 @@ pipeline {
'clean install -Pwildfly-domain,h2,engine-integration-jakarta',
runtimeStash: true,
archiveStash: true,
// we need to use JDK 17 for WildFly 27+ + Spring 6
// we need to use JDK 17 for Spring 6
jdkVersion: 'jdk-17-latest')
},
postFailure: {
Expand All @@ -518,7 +517,7 @@ pipeline {
'clean install -Pwildfly,wildfly-servlet,h2,engine-integration-jakarta',
runtimeStash: true,
archiveStash: true,
// we need to use JDK 17 for WildFly 27+ + Spring 6
// we need to use JDK 17 for Spring 6
jdkVersion: 'jdk-17-latest')
},
postFailure: {
Expand Down
14 changes: 2 additions & 12 deletions clients/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ The **Camunda External Task Client (Java)** allows to set up remote Service Task
* The topic subscription can be configured with the fluent api of the [TopicSubscriptionBuilder](client/src/main/java/org/camunda/bpm/client/topic/TopicSubscriptionBuilder.java).

## Prerequisites
* Oracle Hotspot v1.8+ (JDK 8)
* Camunda BPM Platform 7.9.0+
* Java (supported version by the used Camunda Platform 7)
* Camunda Platform 7

## Maven coordinates
The following Maven coordinate needs to be added to the projects `pom.xml`:
Expand All @@ -37,16 +37,6 @@ The following Maven coordinate needs to be added to the projects `pom.xml`:
</dependency>
```

### JDK 9+ Support
If you want to use a JDK higher than 1.8, please add the following dependency to the projects `pom.xml`:
```xml
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.4</version>
</dependency>
```

## Contributing

Have a look at our [contribution guide](https://github.com/camunda/camunda-bpm-platform/blob/master/CONTRIBUTING.md) for how to contribute to this repository.
Expand Down
25 changes: 7 additions & 18 deletions clients/java/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${version.xml.jaxb-impl}</version>
<scope>provided</scope>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -314,22 +321,4 @@

</build>

<profiles>
<profile>
<id>jdk-9-plus</id>
<activation>
<jdk>(1.8,)</jdk>
</activation>

<dependencies>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${version.xml.jaxb-impl}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
</profiles>

</project>
2 changes: 1 addition & 1 deletion database/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<!-- database driver versions -->
<version.h2>2.1.214</version.h2>
<version.h2-v1>1.4.190</version.h2-v1><!-- used for instance migration qa -->
<version.h2-v1>1.4.200</version.h2-v1><!-- used for instance migration qa -->
<version.oracle>19.3.0.0</version.oracle>
<version.mariadb>1.7.6</version.mariadb>
<version.mariadb-v1>1.1.8</version.mariadb-v1>
Expand Down
13 changes: 0 additions & 13 deletions distro/run/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,6 @@
<groupId>org.camunda.bpm.springboot</groupId>
<artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
</dependency>

<!-- jersey-server (transitive dependency of camunda-bpm-spring-boot-starter-rest)
requires JAXB API and Activation API
to be present; Its pom has an optional profile
(activated by Java 11+) that adds these dependencies.
However, in order to be able to build Run with Java 8 and
operate it with Java 11+, we must have a
direct dependency to JAXB, regardless which Java version we
use for building -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
2 changes: 1 addition & 1 deletion distro/wildfly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<message>
*****************************************************************************************************
* *
* You must use at least JDK 11 to compile Camunda Platform Wildfly!!! *
* You must use at least JDK 11 to compile Camunda Platform Wildfly!!! *
* *
*****************************************************************************************************
</message>
Expand Down
4 changes: 2 additions & 2 deletions distro/wildfly26/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
<configuration>
<rules>
<requireJavaVersion>
<version>[1.8,)</version>
<version>[11,)</version>
<message>
*****************************************************************************************************
* *
* You must use at least JDK 1.8 to compile Camunda Platform Wildfly!!! *
* You must use at least JDK 11 to compile Camunda Platform Wildfly!!! *
* *
*****************************************************************************************************
</message>
Expand Down
13 changes: 1 addition & 12 deletions engine-cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,7 @@

<modules>
<module>core</module>
<module>jakarta</module>
</modules>

<profiles>
<profile>
<id>jdk11</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<modules>
<module>jakarta</module>
</modules>
</profile>
</profiles>

</project>
22 changes: 5 additions & 17 deletions engine-plugins/spin-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -141,21 +146,4 @@
</plugins>
</build>

<profiles>
<profile>
<id>jdk9-and-onwards</id>
<activation>
<jdk>[9,)</jdk>
</activation>

<dependencies>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>

</project>
3 changes: 2 additions & 1 deletion engine-rest/engine-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
<artifactId>jackson-jaxrs-json-provider</artifactId>
<!--
* Since version 2.10.0 this dependency comes with transitive Jakarta dependencies
* These trans-deps are directly included in JDKs <= Java 8 * For Java >= 9 compatible containers, we make sure to include these dependencies
* These trans-deps are directly included in JDKs <= Java 8
* For Java >= 9 compatible containers, we make sure to include these dependencies
-->
<exclusions>
<exclusion>
Expand Down
15 changes: 2 additions & 13 deletions engine-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,12 @@

<modules>
<module>engine-rest</module>
<module>engine-rest-jakarta</module>
<module>engine-rest-openapi</module>
<module>engine-rest-openapi-generator</module>
<module>assembly</module>
<module>assembly-jakarta</module>
<module>docs</module>
</modules>

<profiles>
<profile>
<id>jdk11-and-onwards</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<modules>
<module>engine-rest-jakarta</module>
<module>assembly-jakarta</module>
</modules>
</profile>
</profiles>

</project>
33 changes: 4 additions & 29 deletions engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@
</camunda.artifact>
<camunda.osgi.export.pkg>
!${camunda.artifact}.engine.variable.*,
${camunda.artifact};${camunda.osgi.version};-noimport:=true,
${camunda.artifact}.application.*;${camunda.osgi.version};-noimport:=true,
${camunda.artifact}.container.*;${camunda.osgi.version};-noimport:=true,
${camunda.artifact}.engine.*;${camunda.osgi.version};-noimport:=true
${camunda.artifact},
${camunda.artifact}.application.*,
${camunda.artifact}.container.*,
${camunda.artifact}.engine.*
</camunda.osgi.export.pkg>
<camunda.osgi.import.additional>
!com.google.gson.*,
Expand Down Expand Up @@ -898,31 +898,6 @@
</pluginManagement>
</build>
</profile>

<profile>
<id>below-java11</id>
<activation>
<jdk>(,11)</jdk>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- Jakarta-based classes can only be used with JDK 11+ -->
<excludes combine.children="append">
<exclude>**/Jakarta*.java</exclude>
</excludes>
<testExcludes>
<exclude>**/Jakarta*.java</exclude>
</testExcludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>

<!-- test profiles -->
<profile>
Expand Down
14 changes: 1 addition & 13 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,7 @@

<modules>
<module>invoice</module>
<module>invoice-jakarta</module>
</modules>

<profiles>
<profile>
<id>jdk11-and-onwards</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<modules>
<module>invoice-jakarta</module>
</modules>
</profile>
</profiles>


</project>
Loading

0 comments on commit 4c65ada

Please sign in to comment.