DATAES-690 - Enable JDK 11+ builds.

This commit is contained in:
Greg Turnquist 2019-11-13 08:29:51 -06:00
parent 8472c296f6
commit 0843481cc5
No known key found for this signature in database
GPG Key ID: CB2FA4D512B5C413
4 changed files with 129 additions and 8 deletions

View File

@ -2,7 +2,6 @@ dist: xenial
language: java
jdk:
- openjdk8
sudo: true
script: "mvn clean dependency:list test -Dsort -U -B"
script: "./mvnw -Pjava11 clean dependency:list test -Dsort -U -B"

45
Jenkinsfile vendored
View File

@ -12,7 +12,28 @@ pipeline {
}
stages {
stage("Test") {
stage("test: baseline (jdk8)") {
when {
anyOf {
branch 'master'
not { triggeredBy 'UpstreamCause' }
}
}
agent {
docker {
image 'adoptopenjdk/openjdk8:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
}
options { timeout(time: 30, unit: 'MINUTES') }
steps {
sh 'rm -rf ?'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -U -B'
}
}
stage("Test other configurations") {
when {
anyOf {
branch 'master'
@ -20,10 +41,10 @@ pipeline {
}
}
parallel {
stage("test: baseline") {
stage("test: baseline (jdk11)") {
agent {
docker {
image 'adoptopenjdk/openjdk8:latest'
image 'adoptopenjdk/openjdk11:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
@ -31,11 +52,27 @@ pipeline {
options { timeout(time: 30, unit: 'MINUTES') }
steps {
sh 'rm -rf ?'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -U -B'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pjava11 clean dependency:list test -Dsort -U -B'
}
}
stage("test: baseline (jdk12)") {
agent {
docker {
image 'adoptopenjdk/openjdk12:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
}
options { timeout(time: 30, unit: 'MINUTES') }
steps {
sh 'rm -rf ?'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pjava11 clean dependency:list test -Dsort -U -B'
}
}
}
}
stage('Release to artifactory') {
when {
anyOf {

View File

@ -10,7 +10,7 @@
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>2.3.0.BUILD-SNAPSHOT</version>
<version>2.3.0.JDK11-SNAPSHOT</version>
</parent>
<name>Spring Data Elasticsearch</name>

View File

@ -0,0 +1,85 @@
/*
* Copyright 2018-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.elasticsearch.bootstrap;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Collections;
import java.util.Set;
import java.util.function.Consumer;
/**
* No words No words can describe this piece of code and why we cannot opt-in/opt-out from JarHell check.
* <p/>
* Elasticsearch wants to raise awareness if there are two classes with the exact same name (class name and package
* name) to avoid downstream issues. Turns out, in some case, such as Java 9 module descriptors, it's perfectly fine to
* have exactly same class names (such as {@code module-info.class}) yet JarHell goes awry and prevents startup.
* <p>
* This class is here to be loaded before ES's JarHell class and to anyone that wants to survive JarHell, leave it here
* or you will die a slow and painful death.
* <p>
* Oh, by the way: If Elasticsearch decides to upgrade JarHell with new method signatures, we should adapt to these.
*
* @author Mark Paluch
*/
public class JarHell {
private JarHell() {}
/**
* Empty stub. Leave it here or you will die a slow and painful death.
*
* @param output
* @throws IOException
* @throws URISyntaxException
*/
public static void checkJarHell(Consumer<String> output) throws IOException, URISyntaxException {}
/**
* Empty stub. Leave it here or you will die a slow and painful death.
*
* @return
*/
public static Set<URL> parseClassPath() {
return Collections.emptySet();
}
/**
* Empty stub. Leave it here or you will die a slow and painful death.
*
* @param urls
* @param output
* @throws URISyntaxException
* @throws IOException
*/
public static void checkJarHell(Set<URL> urls, Consumer<String> output) throws URISyntaxException, IOException {}
/**
* Empty stub. Leave it here or you will die a slow and painful death.
*
* @param targetVersion
*/
public static void checkVersionFormat(String targetVersion) {}
/**
* Empty stub. Leave it here or you will die a slow and painful death.
*
* @param resource
* @param targetVersion
*/
public static void checkJavaVersion(String resource, String targetVersion) {}
}