You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by "Baron, Randy" <ra...@roche.com> on 2010/01/07 15:15:04 UTC

ivy extra attributes not available in build.xml?

hi,
  I've been trying to use ivy "extra attributes" but am not entirely successful.  When I try the publish ant task and use my extra attribute in the artifact pattern the attribute doesn't seem to be defined.

Some relevant snippets:
ivy.xml
<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra" >
    <info organisation="someorg" module="gvs"  e:submodule="gvs-orm"/>
    <publications>
        ...etc.

build.xml:
<project name="gvs-orm" default="all" basedir="." >
    <import file="ivy-init.xml"/>
...
ivy-init.xml:
     <target name="publish" depends="resolve" description="--> compile test and publish this project in the local ivy repository">
        <!-- according to http://ant.apache.org/ivy/history/trunk/use/info.html shouldn't ivy.extra.submodule variable be set now? -->
        <echo message="extra attribute 'submodule': ${ivy.extra.submodule}"/>
        <ivy:publish overwrite="true" resolver="filesystem-inhouse" pubrevision="${software.version}" >
        <artifacts pattern="dist/${ivy.extra.submodule}-[revision].[ext]"/>
<!--    <artifacts pattern="dist/${ivy.extra.submodule}-[revision].[ext]"/>   this didn't work either-->
        </ivy:publish>
    </target>


When I run "ant publish" it prints:
        [echo] extra attribute 'submodule': ${ivy.extra.submodule}
so, the apparently variable is undefined, and then puts an ivy file in "dist" but with the (bad) name "${ivy.extra.submodule}-1.0.9.xml"

I have tried many other things--using [submodule] or [e:submodule] in the pattern, adding xmlns:e to the build, etc.--but nothing worked so far.

Anyone know what might be going wrong?
regards,
Randy


RE: ivy extra attributes not available in build.xml?

Posted by "Baron, Randy" <ra...@roche.com>.
hi,
 ah-ha...no, and when I add <ivy:info/> I do indeed get a value for my ${ivy.extra.submodule} property. Thanks.  I still can't use [submodule] in the publish pattern though:

 <ivy:publish overwrite="true" resolver="filesystem-inhouse" pubrevision="${software.version}" >
            <artifacts pattern="dist/${ivy.extra.submodule}-[revision].[ext]"/> 
<!--this fails:  <artifacts pattern="dist/[submodule]-[revision].[ext]"/>   -->

...although I guess I can use the property as above instead.

  So it kind of works now but although it publishes my app jar and a resource jar (the jars from my build), with the right names, they are in fact both the same jar file.  I guess it's something with the (confusing) way patterns work for publishing.

regards,
Randy

-----Original Message-----
From: Maarten Coene [mailto:maarten_coene@yahoo.com] 
Sent: Friday, January 08, 2010 12:18 AM
To: ivy-user@ant.apache.org
Subject: Re: ivy extra attributes not available in build.xml?

Are you sure you call the ivy:info task?
I don't see this in your build.xml snippet.

Maarten




----- Original Message ----
From: "Baron, Randy" <ra...@roche.com>
To: "ivy-user@ant.apache.org" <iv...@ant.apache.org>
Sent: Thu, January 7, 2010 3:15:04 PM
Subject: ivy extra attributes not available in build.xml?


hi,
  I've been trying to use ivy "extra attributes" but am not entirely successful.  When I try the publish ant task and use my extra attribute in the artifact pattern the attribute doesn't seem to be defined.

Some relevant snippets:
ivy.xml
<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra" >
    <info organisation="someorg" module="gvs"  e:submodule="gvs-orm"/>
    <publications>
        ...etc.

build.xml:
<project name="gvs-orm" default="all" basedir="." >
    <import file="ivy-init.xml"/>
...
ivy-init.xml:
     <target name="publish" depends="resolve" description="--> compile test and publish this project in the local ivy repository">
        <!-- according to http://ant.apache.org/ivy/history/trunk/use/info.html shouldn't ivy.extra.submodule variable be set now? -->
        <echo message="extra attribute 'submodule': ${ivy.extra.submodule}"/>
        <ivy:publish overwrite="true" resolver="filesystem-inhouse" pubrevision="${software.version}" >
        <artifacts pattern="dist/${ivy.extra.submodule}-[revision].[ext]"/>
<!--    <artifacts pattern="dist/${ivy.extra.submodule}-[revision].[ext]"/>   this didn't work either-->
        </ivy:publish>
    </target>


When I run "ant publish" it prints:
        [echo] extra attribute 'submodule': ${ivy.extra.submodule} so, the apparently variable is undefined, and then puts an ivy file in "dist" but with the (bad) name "${ivy.extra.submodule}-1.0.9.xml"

I have tried many other things--using [submodule] or [e:submodule] in the pattern, adding xmlns:e to the build, etc.--but nothing worked so far.

Anyone know what might be going wrong?
regards,
Randy


      

Re: ivy extra attributes not available in build.xml?

Posted by Maarten Coene <ma...@yahoo.com>.
Are you sure you call the ivy:info task?
I don't see this in your build.xml snippet.

Maarten




----- Original Message ----
From: "Baron, Randy" <ra...@roche.com>
To: "ivy-user@ant.apache.org" <iv...@ant.apache.org>
Sent: Thu, January 7, 2010 3:15:04 PM
Subject: ivy extra attributes not available in build.xml?


hi,
  I've been trying to use ivy "extra attributes" but am not entirely successful.  When I try the publish ant task and use my extra attribute in the artifact pattern the attribute doesn't seem to be defined.

Some relevant snippets:
ivy.xml
<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra" >
    <info organisation="someorg" module="gvs"  e:submodule="gvs-orm"/>
    <publications>
        ...etc.

build.xml:
<project name="gvs-orm" default="all" basedir="." >
    <import file="ivy-init.xml"/>
...
ivy-init.xml:
     <target name="publish" depends="resolve" description="--> compile test and publish this project in the local ivy repository">
        <!-- according to http://ant.apache.org/ivy/history/trunk/use/info.html shouldn't ivy.extra.submodule variable be set now? -->
        <echo message="extra attribute 'submodule': ${ivy.extra.submodule}"/>
        <ivy:publish overwrite="true" resolver="filesystem-inhouse" pubrevision="${software.version}" >
        <artifacts pattern="dist/${ivy.extra.submodule}-[revision].[ext]"/>
<!--    <artifacts pattern="dist/${ivy.extra.submodule}-[revision].[ext]"/>   this didn't work either-->
        </ivy:publish>
    </target>


When I run "ant publish" it prints:
        [echo] extra attribute 'submodule': ${ivy.extra.submodule}
so, the apparently variable is undefined, and then puts an ivy file in "dist" but with the (bad) name "${ivy.extra.submodule}-1.0.9.xml"

I have tried many other things--using [submodule] or [e:submodule] in the pattern, adding xmlns:e to the build, etc.--but nothing worked so far.

Anyone know what might be going wrong?
regards,
Randy