Skip to content

Commit

Permalink
[refactor] Update build for Java 17
Browse files Browse the repository at this point in the history
  • Loading branch information
adamretter committed Sep 27, 2022
1 parent f051e2f commit 2719466
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 152 deletions.
24 changes: 0 additions & 24 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ updates:
time: "03:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: com.github.ben-manes.caffeine:caffeine
versions:
- ">= 3.a, < 4"
- dependency-name: org.apache.lucene:lucene-analyzers-common
versions:
- ">= 8.a, < 9"
Expand All @@ -28,31 +25,10 @@ updates:
- dependency-name: org.apache.lucene:lucene-queryparser
versions:
- ">= 8.a, < 9"
- dependency-name: org.aspectj:aspectjrt
versions:
- "> 1.9.4, < 1.10"
- dependency-name: org.aspectj:aspectjtools
versions:
- "> 1.9.4, < 1.10"
- dependency-name: net.sf.saxon:Saxon-HE
versions:
> "9"
- dependency-name: org.hsqldb:hsqldb
versions:
- 2.6.0
- dependency-name: com.ibm.icu:icu4j
versions:
- "69.1"
- dependency-name: com.sun.mail:jakarta.mail
versions:
- 2.0.1
- dependency-name: com.sun.activation:jakarta.activation
versions:
- 2.0.1
- dependency-name: com.mycila:license-maven-plugin
versions:
- "4.0"
- 4.0.rc2
- dependency-name: org.owasp:dependency-check-maven
versions:
- 6.1.3
6 changes: 3 additions & 3 deletions .github/workflows/ci-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Set up JDK 8
uses: actions/setup-java@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '8'
java-version: '17'
- name: Make buildkit default
uses: docker/setup-buildx-action@v1
id: buildx
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
name: ${{ matrix.jdk }} Javadocs
strategy:
matrix:
jdk: ['8','11', '16']
jdk: ['17']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.jdk }}
Expand All @@ -27,5 +27,4 @@ jobs:
restore-keys: ${{ runner.os }}-m2
- name: Maven Javadoc
run: mvn -V -B -q -T 2C javadoc:javadoc
continue-on-error: ${{ matrix.jdk != '8' }}

8 changes: 2 additions & 6 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,19 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
jdk: ['8', '11']
include:
- os: ubuntu-latest
jdk: '16'
jdk: ['17']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.jdk }}
cache: 'maven'
- name: Maven Test
timeout-minutes: 60
run: mvn -V -B -DtrimStackTrace=false clean verify
continue-on-error: ${{ matrix.jdk == '16' }}
- name: Maven Code Coverage
if: ${{ github.ref == 'refs/heads/develop' && matrix.jdk == '8' && matrix.os == 'ubuntu-latest' }}
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-xqts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '8'
java-version: '17'
cache: 'maven'
- name: Maven XQTS Build
run: mvn -V -B clean package -DskipTests -Ddependency-check.skip=true --projects exist-xqts --also-make
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .idea/runConfigurations/Java_Admin_Client.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/Jetty_Server.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/Local_Jetty_Server.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Building eXist-db from Source
--------------------------

eXist-db itself is written in Java 8. The build system is [Apache Maven](http://maven.apache.org/). If you're not familiar with Git, we recommend [this excellent online interactive tutorial](http://try.github.io).
eXist-db itself is written in Java 17. The build system is [Apache Maven](http://maven.apache.org/). If you're not familiar with Git, we recommend [this excellent online interactive tutorial](http://try.github.io).

To build eXist-db:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![Coverage Status](https://coveralls.io/repos/github/eXist-db/exist/badge.svg?branch=develop)](https://coveralls.io/github/eXist-db/exist?branch=develop)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ae1c8a7eb1164e919b0ac3c8588560c6)](https://www.codacy.com/gh/eXist-db/exist/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=eXist-db/exist&amp;utm_campaign=Badge_Grade)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=eXist-db_exist&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=eXist-db_exist)
[![Java 8](https://img.shields.io/badge/java-8-blue.svg)](https://adoptopenjdk.net/)
[![Java 17](https://img.shields.io/badge/java-17-blue.svg)](https://adoptopenjdk.net/)
[![License](https://img.shields.io/badge/license-LGPL%202.1-blue.svg)](https://www.gnu.org/licenses/lgpl-2.1.html)
[![Download](https://img.shields.io/github/v/release/eXist-db/exist.svg)](https://github.com/eXist-db/exist/releases/)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.exist-db/exist/badge.svg)](https://search.maven.org/search?q=g:org.exist-db)
Expand Down
44 changes: 35 additions & 9 deletions exist-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<artifactId>jing</artifactId>
<version>20220510</version>
<exclusions>
<exclusion> <!-- conflicts with xerces 2.12.2 dependency on xml-apis version 1.4.01 -->
<exclusion> <!-- conflicts with Java 17's javax.xml module -->
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
Expand Down Expand Up @@ -272,6 +272,12 @@
<artifactId>xercesImpl</artifactId>
<version>2.12.2</version>
<classifier>xml-schema-1.1</classifier>
<exclusions>
<exclusion> <!-- conflicts with Java 17's javax.xml module -->
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -287,14 +293,16 @@
</exclusions>
</dependency>

<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.util</groupId>
<artifactId>ws-commons-util</artifactId>
<version>1.0.2</version>
<exclusions>
<exclusion> <!-- conflicts with Java 17's javax.xml module -->
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- xml-resolver is needed at runtime because xercesImpl declares this as optional,
Expand All @@ -310,6 +318,12 @@
<groupId>org.xmlresolver</groupId>
<artifactId>xmlresolver</artifactId>
<version>${xmlresolver.version}</version>
<exclusions>
<exclusion> <!-- conflicts with Java 17's javax.xml module -->
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -318,6 +332,12 @@
<version>${xmlresolver.version}</version>
<classifier>data</classifier>
<scope>runtime</scope>
<exclusions>
<exclusion> <!-- conflicts with Java 17's javax.xml module -->
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- xpath2 and java-cup are needed at runtime because xercesImpl declares this as optional,
Expand All @@ -338,7 +358,13 @@
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.2</version> <!-- needed an compile time for various dependencies -->
<version>2.7.2</version> <!-- needed at compile time for various dependencies -->
<exclusions>
<exclusion> <!-- conflicts with Java 17's javax.xml module -->
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -363,7 +389,7 @@
<groupId>com.evolvedbinary.thirdparty.org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-common</artifactId>
<exclusions>
<exclusion> <!-- conflicts with xerces 2.12.0 dependency on xml-apis version 1.4.01 -->
<exclusion> <!-- conflicts with Java 17's javax.xml module -->
<artifactId>xml-apis</artifactId>
<groupId>xml-apis</groupId>
</exclusion>
Expand Down Expand Up @@ -976,9 +1002,9 @@ The BaseX Team. The original license statement is also included below.]]></pream
</plugin>

<plugin>
<groupId>com.nickwongdev</groupId>
<groupId>dev.aspectj</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.12.6</version>
<version>1.13.1</version>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
Expand Down

This file was deleted.

29 changes: 12 additions & 17 deletions exist-docker/src/main/resources-filtered/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,25 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#

# Install latest JRE 8 in Debian Stretch (which is the base of gcr.io/distroless/java:8)
FROM debian:stretch-slim as updated-jre
# Use Debian Bullseye (which is the base of gcr.io/distroless/java:17) for additional library dependencies that we need
FROM debian:bullseye-slim as debian-slim
RUN apt-get update && apt-get -y dist-upgrade
RUN apt-get install -y openjdk-8-jre-headless
RUN apt-get install -y openjdk-17-jre-headless
RUN apt-get install -y expat fontconfig # Install tools required by FOP

FROM gcr.io/distroless/java:8

# Copy over updated JRE from Debian Stretch
COPY --from=updated-jre /etc/java-8-openjdk /etc/java-8-openjdk
COPY --from=updated-jre /usr/lib/jvm/java-8-openjdk-amd64 /usr/lib/jvm/java-8-openjdk-amd64
COPY --from=updated-jre /usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64 /usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64
FROM gcr.io/distroless/java17

# Copy over dependencies for Apache FOP, missing from GCR's JRE
COPY --from=updated-jre /usr/lib/x86_64-linux-gnu/libfreetype.so.6 /usr/lib/x86_64-linux-gnu/libfreetype.so.6
COPY --from=updated-jre /usr/lib/x86_64-linux-gnu/liblcms2.so.2 /usr/lib/x86_64-linux-gnu/liblcms2.so.2
COPY --from=updated-jre /usr/lib/x86_64-linux-gnu/libpng16.so.16 /usr/lib/x86_64-linux-gnu/libpng16.so.16
COPY --from=updated-jre /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1
COPY --from=debian-slim /usr/lib/x86_64-linux-gnu/libfreetype.so.6 /usr/lib/x86_64-linux-gnu/libfreetype.so.6
COPY --from=debian-slim /usr/lib/x86_64-linux-gnu/liblcms2.so.2 /usr/lib/x86_64-linux-gnu/liblcms2.so.2
COPY --from=debian-slim /usr/lib/x86_64-linux-gnu/libpng16.so.16 /usr/lib/x86_64-linux-gnu/libpng16.so.16
COPY --from=debian-slim /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1

# Copy dependencies for Apache Batik (used by Apache FOP to handle SVG rendering)
COPY --from=updated-jre /etc/fonts /etc/fonts
COPY --from=updated-jre /lib/x86_64-linux-gnu/libexpat.so.1 /lib/x86_64-linux-gnu/libexpat.so.1
COPY --from=updated-jre /usr/share/fontconfig /usr/share/fontconfig
COPY --from=updated-jre /usr/share/fonts/truetype/dejavu /usr/share/fonts/truetype/dejavu
COPY --from=debian-slim /etc/fonts /etc/fonts
COPY --from=debian-slim /lib/x86_64-linux-gnu/libexpat.so.1 /lib/x86_64-linux-gnu/libexpat.so.1
COPY --from=debian-slim /usr/share/fontconfig /usr/share/fontconfig
COPY --from=debian-slim /usr/share/fonts/truetype/dejavu /usr/share/fonts/truetype/dejavu

# Copy eXist-db
COPY LICENSE /exist/LICENSE
Expand Down
Loading

0 comments on commit 2719466

Please sign in to comment.