[MNG-7911] Require JDK 11 and support JDK 21 at build time (#1278)

This commit is contained in:
Guillaume Nodet 2023-10-16 13:25:27 +02:00 committed by GitHub
parent 79c09f2800
commit 07db6ec76a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 68 additions and 6 deletions

View File

@ -42,7 +42,7 @@ jobs:
- uses: actions/setup-java@v3
with:
java-version: 8
java-version: 11
distribution: 'temurin'
cache: 'maven'
@ -61,7 +61,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
java: [8, 11, 17]
java: [11, 17, 21]
fail-fast: false
runs-on: ${{ matrix.os }}

View File

@ -31,7 +31,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
java: [8, 17, 20]
java: [11, 17, 21]
fail-fast: false
runs-on: ${{ matrix.os }}

4
Jenkinsfile vendored
View File

@ -20,10 +20,10 @@
properties([buildDiscarder(logRotator(artifactNumToKeepStr: '5', numToKeepStr: env.BRANCH_NAME=='master'?'5':'1'))])
def buildOs = 'linux'
def buildJdk = '8'
def buildJdk = '11'
def buildMvn = '3.8.x'
def runITsOses = ['linux']
def runITsJdks = ['8', '11', '17']
def runITsJdks = ['11', '17', '21']
def runITsMvn = '3.8.x'
def runITscommand = "mvn clean install -Prun-its,embedded -B -U -V" // -DmavenDistro=... -Dmaven.test.failure.ignore=true
def tests

View File

@ -24,6 +24,7 @@ import java.beans.PropertyDescriptor;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import org.apache.maven.model.Model;
@ -136,6 +137,10 @@ public class BuildModelSourceTransformerTest {
}
BeanInfo bean = Introspector.getBeanInfo(m1.getClass());
for (PropertyDescriptor prop : bean.getPropertyDescriptors()) {
if (("first".equals(prop.getName()) || "last".equals(prop.getName()))
&& List.class.equals(prop.getReadMethod().getDeclaringClass())) {
continue;
}
Object p1 = prop.getReadMethod().invoke(m1);
Object p2 = prop.getReadMethod().invoke(m2);
if (!equalsDeep(p1, p2)) {

59
pom.xml
View File

@ -151,7 +151,7 @@ under the License.
<commonsCliVersion>1.5.0</commonsCliVersion>
<commonsIoVersion>2.11.0</commonsIoVersion>
<junitVersion>5.10.0</junitVersion>
<mockitoVersion>4.11.0</mockitoVersion>
<mockitoVersion>5.2.0</mockitoVersion>
<plexusInterpolationVersion>1.26</plexusInterpolationVersion>
<plexusXmlVersion>4.0.1</plexusXmlVersion>
<guiceVersion>5.1.0</guiceVersion>
@ -468,6 +468,11 @@ under the License.
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.14.9</version>
</dependency>
</dependencies>
<!--bootstrap-start-comment-->
</dependencyManagement>
@ -490,6 +495,38 @@ under the License.
<build>
<pluginManagement>
<plugins>
<!-- Remove when Parent 41 used -->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.40.0</version>
<configuration>
<java>
<!-- orders of used formatters are important MPOM-376 -->
<!-- eg. palantir override importOrder, so should be first -->
<palantirJavaFormat>
<version>2.38.0</version>
</palantirJavaFormat>
<removeUnusedImports />
<importOrder>
<file>config/maven-eclipse-importorder.txt</file>
</importOrder>
<licenseHeader>
<file>config/maven-header-plain.txt</file>
</licenseHeader>
</java>
<pom>
<sortPom>
<expandEmptyElements>false</expandEmptyElements>
<!-- https://issues.apache.org/jira/browse/MRELEASE-1111 -->
<spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
</sortPom>
</pom>
<upToDateChecking>
<enabled>true</enabled>
</upToDateChecking>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
@ -642,6 +679,26 @@ under the License.
<fail>true</fail>
</configuration>
</execution>
<execution>
<id>enforce-bytecode-version</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>[11,)</version>
</requireJavaVersion>
<enforceBytecodeVersion>
<maxJdkVersion>${maven.compiler.target}</maxJdkVersion>
<ignoredScopes>
<ignoredScope>test</ignoredScope>
</ignoredScopes>
</enforceBytecodeVersion>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>