ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Clitheroe <g.clithe...@gmail.com>
Subject Re: ivy:buildnumber bug with m2compatible resolver? Ivy 2.1.0-rc1
Date Thu, 21 May 2009 21:16:14 GMT
And here is my current, slightly more complete, work around.  It's
core ant but does need jvm 1.6+ to support the script engine without
requiring additional jars.

<ivy:info settingsRef="ivy.geonet"/>

<script language="javascript" manager="javax">
      var org = project.getProperty("ivy.organisation");
       project.setNewProperty("ivy.organisation.translated",
org.replace("\.","/"));
</script>

<ivy:buildnumber settingsRef="ivy.geonet"
  resolver="geonet-enterprise-publish-http"
  organisation="${ivy.organisation.translated}"
  module="${ivy.module}"
  revision="${ivy.revision}"
  default="1.0.0" defaultBuildNumber="1" revSep="."/>


Cheers,
Geoff


On Thu, May 21, 2009 at 9:07 AM, Geoff Clitheroe <g.clitheroe@gmail.com> wrote:
> Hi,
>
> I am trying to get the next build number using ivy:buildnumber to
> query a m2compatible repo.  It seems like the '.' in organization
> doesn't get translated so as to be m2compatible and so I just keep
> getting the default build number unless I translate organisation
> manually.  Is there something I'm missing?
>
> In the examples below I have version 1.0.5 in the repo so I would
> expect to see 1.0.6 as the next build number.
>
> The resolver used:
>
> <url name="geonet-enterprise-publish-http" m2compatible="true">
> <ivy pattern="${geonet.repo}/publish/${ivy.shared.m2.ivy.pattern}"/>
> <artifact pattern="${geonet.repo}/publish/${ivy.shared.m2.artifact.pattern}"/>
> </url>
>
> Try to get build number using organistation found from ivy.xml = nz.org.geonet
>
> <ivy:info settingsRef="ivy.geonet"/>
>
> <ivy:buildnumber settingsRef="ivy.geonet"
>       resolver="geonet-enterprise-publish-http"
>       organisation="${ivy.organisation}"
>       module="${ivy.module}"
>       default="1.0.0" defaultBuildNumber="1" revSep="."/>
>
> ant -d .....
>
> [ivy:buildnumber]       using geonet-enterprise-publish-http to list all in
> http://repo.geonet.org.nz/maven/maven2/publish/
> [ivy:buildnumber] ApacheURLLister found
> URL=[http://repo.geonet.org.nz/maven/maven2/publish/nz/].
> [ivy:buildnumber] ApacheURLLister found
> URL=[http://repo.geonet.org.nz/maven/maven2/publish/nz/].
> [ivy:buildnumber]               found 1 resources
> Overriding previous definition of property "ivy.new.revision"
> Setting project property: ivy.new.revision -> 1.0.0
>
>
> Then manually change organisation to match the repo layout and it works ok.
>
> <ivy:info settingsRef="ivy.geonet"/>
>
> <ivy:buildnumber settingsRef="ivy.geonet"
>       resolver="geonet-enterprise-publish-http"
>       organisation="nz/org/geonet"
>       module="${ivy.module}"
>       default="1.0.0" defaultBuildNumber="1" revSep="."/>
>
> ant -d ....
>
> ivy:buildnumber] ApacheURLLister found
> URL=[http://repo.geonet.org.nz/maven/maven2/publish/nz/org/geonet/geonet-util/1.0.5/ivy-1.0.5.xml.sha1].
> [ivy:buildnumber]               found 12 urls
> [ivy:buildnumber]               3 matched
> http://repo.geonet.org.nz/maven/maven2/publish/nz/org/geonet/geonet-util/1.0.5/[artifact]-1.0.5.jar
> Overriding previous definition of property "ivy.revision"
> Setting project property: ivy.revision -> 1.0.5
> Overriding previous definition of property "ivy.new.revision"
> Setting project property: ivy.new.revision -> 1.0.6
>
>
> Is there something I'm missing here?  Full Ivy settings are at end.
>
> Thanks a lot,
> Geoff
>
> ivysettings.xml:
>
> <ivysettings>
> <settings defaultResolver="default"/>
> <include url="http://repo.geonet.org.nz/maven/maven2/resolvers/ivysettings-shared.xml"/>
> <include url="${ivy.default.settings.dir}/ivysettings-public.xml"/>
> <include url="${ivy.default.settings.dir}/ivysettings-local.xml"/>
> <include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml"/>
> <include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"/>
> </ivysettings>
>
>
> ivysettings-shared.xml:
>
> <ivysettings>
> <property name="ivy.shared.m2.ivy.pattern"
> value="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
> override="false"/>
> <property name="ivy.shared.m2.artifact.pattern"
> value="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
> override="false"/>
> <property name="geonet.repo"
> value="http://repo.geonet.org.nz/maven/maven2" override="false"/>
> <credentials host="repo.geonet.org.nz" realm="omitted"
> username="omitted" passwd="omitted"/>
>
> <resolvers>
>
> <url name="geonet-enterprise-manual-http" m2compatible="true">
> <ivy pattern="${geonet.repo}/manual/${ivy.shared.m2.ivy.pattern}"/>
> <artifact pattern="${geonet.repo}/manual/${ivy.shared.m2.artifact.pattern}"/>
> </url>
>
> <url name="geonet-enterprise-mirror-http" m2compatible="true">
> <ivy pattern="${geonet.repo}/mirror/${ivy.shared.m2.ivy.pattern}"/>
> <artifact pattern="${geonet.repo}/mirror/${ivy.shared.m2.artifact.pattern}"/>
> </url>
>
> <url name="java.net" m2compatible="true">
> <ivy pattern="http://download.java.net/maven/2/${ivy.shared.m2.ivy.pattern}"/>
> <artifact pattern="http://download.java.net/maven/2/${ivy.shared.m2.artifact.pattern}"/>
> </url>
>
> <url name="geonet-enterprise-publish-http" m2compatible="true">
> <ivy pattern="${geonet.repo}/publish/${ivy.shared.m2.ivy.pattern}"/>
> <artifact pattern="${geonet.repo}/publish/${ivy.shared.m2.artifact.pattern}"/>
> </url>
>
> <chain name="shared">
> <resolver ref="geonet-enterprise-manual-http"/>
> <resolver ref="geonet-enterprise-mirror-http"/>
> <resolver ref="geonet-enterprise-publish-http"/>
> <resolver ref="java.net"/>
> </chain>
> </resolvers>
> </ivysettings>
>

Mime
View raw message