Skip to content

Commit

Permalink
Use Maven with OpenJDK 17 on RHEL 9
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Feb 14, 2025
1 parent cb2c49b commit 77cceb3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pki.spec
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,24 @@ ExcludeArch: i686
# Java
################################################################################

# use Java 17 on Fedora 39 or older and RHEL 9 or older
# otherwise, use Java 21

# maven-local is a subpackage of javapackages-tools

%if 0%{?fedora} && 0%{?fedora} <= 39 || 0%{?rhel} && 0%{?rhel} <= 9

# use Java 17 on Fedora 39 or older and RHEL 9 or older
%define java_devel java-17-openjdk-devel
%define java_headless java-17-openjdk-headless
%define java_home %{_jvmdir}/jre-17-openjdk
%define maven_local maven-local-openjdk17

%else

# otherwise, use Java 21
%define java_devel java-21-openjdk-devel
%define java_headless java-21-openjdk-headless
%define java_home %{_jvmdir}/jre-21-openjdk
%define maven_local maven-local

%endif

Expand Down Expand Up @@ -181,7 +186,7 @@ BuildRequires: policycoreutils

# Java build dependencies
BuildRequires: %{java_devel}
BuildRequires: maven-local
BuildRequires: %{maven_local}
%if 0%{?fedora}
BuildRequires: xmvn-tools
%endif
Expand Down

0 comments on commit 77cceb3

Please sign in to comment.