From b0c39f1527eeec551d6d58134a03207e2be729d6 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Wed, 25 Mar 2020 07:00:47 +0100 Subject: [PATCH] Fix test failures when JAVA_HOME is not set --- ...TH-env-variable-instead-of-JAVA_HOME.patch | 39 +++++++++++++++++++ plexus-interpolation.spec | 3 ++ 2 files changed, 42 insertions(+) create mode 100644 0001-Use-PATH-env-variable-instead-of-JAVA_HOME.patch diff --git a/0001-Use-PATH-env-variable-instead-of-JAVA_HOME.patch b/0001-Use-PATH-env-variable-instead-of-JAVA_HOME.patch new file mode 100644 index 0000000..daf4bab --- /dev/null +++ b/0001-Use-PATH-env-variable-instead-of-JAVA_HOME.patch @@ -0,0 +1,39 @@ +From d6623bd636d7f07aa8c73234375bdd11ccd6ee95 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Wed, 25 Mar 2020 06:58:13 +0100 +Subject: [PATCH] Use PATH env variable instead of JAVA_HOME + +--- + .../plexus/interpolation/EnvarBasedValueSourceTest.java | 2 +- + .../plexus/interpolation/fixed/EnvarBasedValueSourceTest.java | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/test/java/org/codehaus/plexus/interpolation/EnvarBasedValueSourceTest.java b/src/test/java/org/codehaus/plexus/interpolation/EnvarBasedValueSourceTest.java +index bc88e8b..6fc4c13 100644 +--- a/src/test/java/org/codehaus/plexus/interpolation/EnvarBasedValueSourceTest.java ++++ b/src/test/java/org/codehaus/plexus/interpolation/EnvarBasedValueSourceTest.java +@@ -87,7 +87,7 @@ public class EnvarBasedValueSourceTest + + EnvarBasedValueSource source = new EnvarBasedValueSource(); + +- String realEnvVar = "JAVA_HOME"; ++ String realEnvVar = "PATH"; + + String realValue = System.getenv().get( realEnvVar ); + assertNotNull( "Can't run this test until " + realEnvVar + " env variable is set", realValue ); +diff --git a/src/test/java/org/codehaus/plexus/interpolation/fixed/EnvarBasedValueSourceTest.java b/src/test/java/org/codehaus/plexus/interpolation/fixed/EnvarBasedValueSourceTest.java +index beaf014..94899d7 100644 +--- a/src/test/java/org/codehaus/plexus/interpolation/fixed/EnvarBasedValueSourceTest.java ++++ b/src/test/java/org/codehaus/plexus/interpolation/fixed/EnvarBasedValueSourceTest.java +@@ -87,7 +87,7 @@ public class EnvarBasedValueSourceTest + + EnvarBasedValueSource source = new EnvarBasedValueSource(); + +- String realEnvVar = "JAVA_HOME"; ++ String realEnvVar = "PATH"; + + String realValue = System.getenv().get( realEnvVar ); + assertNotNull( "Can't run this test until " + realEnvVar + " env variable is set", realValue ); +-- +2.21.0 + diff --git a/plexus-interpolation.spec b/plexus-interpolation.spec index 5878d8f..da41568 100644 --- a/plexus-interpolation.spec +++ b/plexus-interpolation.spec @@ -9,6 +9,8 @@ BuildArch: noarch Source0: https://github.com/codehaus-plexus/plexus-interpolation/archive/plexus-interpolation-%{version}.tar.gz +Patch0: 0001-Use-PATH-env-variable-instead-of-JAVA_HOME.patch + BuildRequires: maven-local-openjdk8 BuildRequires: mvn(junit:junit) BuildRequires: mvn(org.codehaus.plexus:plexus-components:pom:) @@ -25,6 +27,7 @@ related projects. %prep %setup -q -n plexus-interpolation-plexus-interpolation-%{version} +%patch0 -p1 %pom_remove_plugin :maven-release-plugin %pom_remove_plugin :maven-scm-publish-plugin