-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 2.73.1
ivy-trigger plugin 0.34
I have a build using the ivy-trigger plugin and in the configuration of the trigger I reference a ivysettings.xml file that contains URL references
<ivysettings> <settings defaultResolver="default"/> <include url="${ivy.settings.dir}/ivysettings-publish.xml"/> <include url=""${ivy.settings.dir}/ivysettings-public.xml"/> <include url=""${ivy.settings.dir}/ivysettings-shared.xml"/> <include url="${ivy.default.settings.dir}/ivysettings-local.xml"/> <include url=""${ivy.settings.dir}/ivysettings-main-chain.xml"/> <include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"/> <latest-strategies> <latest-revision name="canoga-revision"> <specialMeaning name="UT" value="-2"/> <specialMeaning name="EB" value="3"/> <specialMeaning name="GA" value="5"/> </latest-revision> </latest-strategies> </ivysettings>
The current implementation of IvyTiggerEvaluator.java makes a temporary copy of the settings file and prepends the values from the environment variables, properties files specified, and properties, and then attempts to parse this temporary file.
This can fail since it is likely that the temporary file is not located where the original settings file was located. So something like the variable "${ivy.settings.dir}" which is set to the directory where the settings file is located is no longer valid.
This implementation can be changed to not need a temporary copy of the settings file. What needs to be done is to create a temporary properties file containing the environment variables, properties files specified, and the properties specified. Then after the IvySettings object is created, the "IvySettings.loadProperties()" method can be called to initialize the IvySettings instance with the properties. Finally the "IvySettings.load(File settingsFile)" or the "IvySettings.load(URL settingsUR)" method can be called to load the settings file without having to create a temporary copy.
I have made such changes locally and these work correctly.