Do not override JAVA_HOME set by user

Resolves: rhbz#2096431
This commit is contained in:
Marián Konček 2022-12-08 13:22:45 +01:00
parent 13ff7e5395
commit 731b1f5afc
2 changed files with 9 additions and 3 deletions

View File

@ -20,11 +20,13 @@ index a554c6617..739501af4 100755
# MAVEN_OPTS (Optional) Java runtime options used when Maven is executed.
# MAVEN_SKIP_RC (Optional) Flag to disable loading of mavenrc files.
# -----------------------------------------------------------------------------
@@ -33,12 +33,16 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then
@@ -33,12 +33,18 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then
. /etc/mavenrc
fi
+ if [ -z "$JAVA_HOME" ] ; then
+ . /etc/java/maven.conf
+ fi
+
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"

View File

@ -7,7 +7,7 @@
Name: maven
Epoch: 1
Version: 3.6.3
Release: 14%{?dist}
Release: 15%{?dist}
Summary: Java project management and project comprehension tool
# maven itself is ASL 2.0
# bundled slf4j is MIT
@ -291,6 +291,10 @@ if [[ $1 -eq 0 ]]; then update-alternatives --remove mvn %{homedir}/bin/mvn; fi
%config %{_javaconfdir}/maven.conf-openjdk17
%changelog
* Thu Dec 01 2022 Marián Konček <mkoncek@redhat.com> - 1:3.6.3-15
- Do not override JAVA_HOME set by user
- Resolves: rhbz#2096431
* Fri Sep 24 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:3.6.3-14
- Add OpenJDK 17 binding