You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Andrew January (JIRA)" <ji...@apache.org> on 2015/09/07 13:56:46 UTC

[jira] [Created] (IVY-1532) Ant properties override version pattern matcher arguments

Andrew January created IVY-1532:
-----------------------------------

             Summary: Ant properties override version pattern matcher arguments
                 Key: IVY-1532
                 URL: https://issues.apache.org/jira/browse/IVY-1532
             Project: Ivy
          Issue Type: Bug
    Affects Versions: 2.4.0
            Reporter: Andrew January
            Priority: Minor


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}}
{code:xml}<version-matchers>
  <pattern-vm name="test-version">
    <match revision="test-version" pattern="${version}" args="version" matcher="exact" />
  </pattern-vm>
</version-matchers>{code}

{{ivy.xml}}
{code:xml}<dependency org="org.apache.ivy" name="ivy" rev="test-version(2.4.0)" />{code}

{{build.xml}}
{code: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>{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)