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.

This commit is contained in:
Steve Rowe 2016-05-17 10:07:14 -04:00
parent 2b9cbe97a8
commit be5172631d
4 changed files with 13 additions and 12 deletions

View File

@ -137,8 +137,8 @@ Other
* LUCENE-7263: Make queryparser/xml/CoreParser's SpanQueryBuilderFactory
accessible 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)

View File

@ -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}"

View File

@ -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}"

View File

@ -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 file
ivySettings.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);
}
}