Apache Lucene open-source search software
SOLR-9121: Fix check-lib-versions task to pass through the "ivysettings.xml" property as an Ivy variable so that the nested ivy settings file can be located when parsing the top-level ivy settings file.
Steve Rowebe5172631d9d
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex 41f77cd6d1f..73a4c21f320 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -137,8 +137,8 @@ Other* LUCENE-7263: Make queryparser/xml/CoreParser's SpanQueryBuilderFactoryaccessible to deriving classes. (Daniel Collins via Christine Poerschke)-* SOLR-9109: Allow specification of a custom Ivy settings file via system- property "ivysettings.xml". (Misha Dmitriev, Uwe Schindler, Steve Rowe)+* SOLR-9109/SOLR-9121: Allow specification of a custom Ivy settings file via system+ property "ivysettings.xml". (Misha Dmitriev, Christine Poerschke, Uwe Schindler, Steve Rowe)======================= Lucene 6.0.1 =======================(No Changes)diff --git a/lucene/build.xml b/lucene/build.xmlindex c03770066d1..f7dffd62c96 100644--- a/lucene/build.xml+++ b/lucene/build.xml@@ -97,7 +97,7 @@description="Verify that the '/org/name' keys in ivy-versions.properties are sorted lexically and are neither duplicates nor orphans, and that all dependencies in all ivy.xml files use rev="$${/org/name}" format."><lib-versions-check-macro dir="${common.dir}/.."centralized.versions.file="${common.dir}/ivy-versions.properties"- ivy.settings.file="${common.dir}/top-level-ivy-settings.xml"+ top.level.ivy.settings.file="${common.dir}/top-level-ivy-settings.xml"ivy.resolution-cache.dir="${ivy.resolution-cache.dir}"ivy.lock-strategy="${ivy.lock-strategy}"common.build.dir="${common.build.dir}"diff --git a/lucene/tools/custom-tasks.xml b/lucene/tools/custom-tasks.xmlindex 71e3f975c9f..11bb4530331 100644--- a/lucene/tools/custom-tasks.xml+++ b/lucene/tools/custom-tasks.xml@@ -88,7 +88,7 @@<macrodef name="lib-versions-check-macro"><attribute name="dir"/><attribute name="centralized.versions.file"/>- <attribute name="ivy.settings.file"/>+ <attribute name="top.level.ivy.settings.file"/><attribute name="ivy.resolution-cache.dir"/><attribute name="ivy.lock-strategy"/><attribute name="common.build.dir"/>@@ -101,7 +101,7 @@--><echo>Lib versions check under: @{dir}</echo><libversions centralizedVersionsFile="@{centralized.versions.file}"- ivySettingsFile="@{ivy.settings.file}"+ topLevelIvySettingsFile="@{top.level.ivy.settings.file}"ivyResolutionCacheDir="@{ivy.resolution-cache.dir}"ivyLockStrategy="@{ivy.lock-strategy}"commonBuildDir="@{common.build.dir}"diff --git a/lucene/tools/src/java/org/apache/lucene/validation/LibVersionsCheckTask.java b/lucene/tools/src/java/org/apache/lucene/validation/LibVersionsCheckTask.javaindex 63aeb32fa4a..3179c78964c 100644--- a/lucene/tools/src/java/org/apache/lucene/validation/LibVersionsCheckTask.java+++ b/lucene/tools/src/java/org/apache/lucene/validation/LibVersionsCheckTask.java@@ -111,9 +111,9 @@ public class LibVersionsCheckTask extends Task {private File ignoreConflictsFile;/**- * Ivy settings file: ivy-settings.xml+ * Ivy settings file: top-level-ivy-settings.xml*/- private File ivySettingsFile;+ private File topLevelIvySettingsFile;/*** Location of common build dir: lucene/build/@@ -180,10 +180,10 @@ public class LibVersionsCheckTask extends Task {centralizedVersionsFile = file;}- public void setIvySettingsFile(File file) {- ivySettingsFile = file;+ public void setTopLevelIvySettingsFile(File file) {+ topLevelIvySettingsFile = file;}-+public void setIvyResolutionCacheDir(File dir) {ivyResolutionCacheDir = dir;}@@ -692,12 +692,13 @@ public class LibVersionsCheckTask extends Task {ivySettings.setVariable("ivy.exclude.types", "source|javadoc");ivySettings.setVariable("ivy.resolution-cache.dir", ivyResolutionCacheDir.getAbsolutePath());ivySettings.setVariable("ivy.lock-strategy", ivyLockStrategy);+ ivySettings.setVariable("ivysettings.xml", getProject().getProperty("ivysettings.xml")); // nested settings fileivySettings.setBaseDir(commonBuildDir);ivySettings.setDefaultConflictManager(new NoConflictManager());ivy = Ivy.newInstance(ivySettings);- ivy.configure(ivySettingsFile);+ ivy.configure(topLevelIvySettingsFile);} catch (Exception e) {- throw new BuildException("Exception reading " + ivySettingsFile.getPath() + ": " + e.toString(), e);+ throw new BuildException("Exception reading " + topLevelIvySettingsFile.getPath() + ": " + e.toString(), e);}}