Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.4.0
-
None
-
None
-
None
Description
The arguments for a pattern version matcher don't override existing properties; if an existing ant property exists that will be used in favour of the pattern argument.
This can be confusing because the natural names for matcher arguments tend to be generic (e.g. "version") which are also likely to be ant properties. This is compounded by the fact the eclipse plugin won't have the same set of properties, so will work in the IDE while the ant build will fail.
In rare cases, if the ant property happens to match a valid revision, it will pick up the wrong revision instead of failing to resolve.
ivysettings.xml
<version-matchers> <pattern-vm name="test-version"> <match revision="test-version" pattern="${version}" args="version" matcher="exact" /> </pattern-vm> </version-matchers>
ivy.xml
<dependency org="org.apache.ivy" name="ivy" rev="test-version(2.4.0)" />
build.xml
<target name="fails-to-resolve" depends="init" description="This fails to resolve anything because it can't find the revision 'IDONTEXIST'"> <ivy:settings file="ivysettings.xml" /> <property name="version" value="IDONTEXIST" /> <ivy:resolve refresh="true" /> </target>