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 Jim White <ji...@pagesmiths.com> on 2008/04/17 09:26:58 UTC

How use a classifier with the Ant tasks? (was Re: Classifier frustration)

I'll try this again without the long folksy preliminaries (see copied 
below).

I need to get an artifact that uses a M2 classifier.  How do I do that 
using the Ivy Ant tasks?

Thanks!

Jim

Jim White wrote:

> Hello Xavier and friends!
> 
> I've been lurking around Ivy for a long while and am glad to see it 
> close to being released as Apache Ant software.
> 
> Today I tried to sort out a problem someone was having using JSON-lib 
> with Groovy and ran smack into a M2 classifier.  So I workaround it sort 
> of this way:
> 
> XWINGS.IVY {
>    info(organisation:"org.ifcx", module:"WingsIvyTest")
>    dependencies {
>        dependency(org:'net.sf.json-lib', name:'json-lib', rev:'2.2.1'
>                   , conf:'default->runtime') {
>            artifact(name:'json-lib', type:'jar',
> url:'http://repo1.maven.org/maven2/net/sf/json-lib/json-lib/2.2.1/json-lib-2.2.1-jdk15.jar') 
> 
>        }
>    }
> }
> 
> Naturally that is not so satisfying, so then I see this ("Re: How can I 
> retrieve binary files and source files in one shot"):
> 
> http://marc.info/?l=ivy-user&m=119939232121568&w=2
> 
> which makes me think, Aha! but alas no joy because if I try to make an 
> Ivy like that I get:
> 
> XWINGS.IVY {
>    info(organisation:"org.ifcx", module:"WingsIvyTest")
>    dependencies {
>        dependency(org:'net.sf.json-lib', name:'json-lib', rev:'2.2.1', 
> conf:'default->runtime') {
>            artifact(name:'json-lib', type:'jar', classifier:'jdk15')
>        }
>    }
> }
> : syntax errors in ivy file: java.text.ParseException: [xml parsing: 
> file:/tmp/ifcx-wings-ivy-23918.xml:5:65: cvc-complex-type.3.2.2: 
> Attribute 'classifier' is not allowed to appear in element 'artifact'. 
> in file:/tmp/ifcx-wings-ivy-23918.xml
> ]
> 
> Same problem if I try that in 'dependency'.  I look into the ivy.xsd in 
> SVN and see that indeed there is no 'classifier' anywhere, nor is there 
> in the related Java files.
> 
> I then find the ResolveTest.java code which uses a classifier in a POM 
> which it hands off to ivy.resolve(File), and so I think Aha! again and 
> set about trying to give the Ivy Ant resolve task a POM, but that 
> doesn't seem to be working out either, although perhaps I just need to 
> do further debugging.
> 
> Is it possible to use a POM with the Ivy Ant tasks?  What do I need to 
> do to use a classifier from the Ant tasks?  It's possible I could use 
> the Ivy Java API, but I'm trying to avoid tying my implementation too 
> closely to Ivy's internals and Ant tasks are preferred.
> 
> Thanks in advance for any pointers.
> 
> And if you want to get a peek at Ivy integrated with Groovy inside 
> OpenOffice, you can try it out here:
> 
> http://www.ifcx.org/
> 
> It's the "IFCX Wings" literate scripting document that is enabled by 
> GroovyForOpenOffice, but you can just look at the document without using 
> G4OO for the macro.
> 
> Jim
> 
> 


Re: How use a classifier with the Ant tasks? (was Re: Classifier frustration)

Posted by Jim White <ji...@pagesmiths.com>.
Xavier Hanin wrote:

> On Thu, Apr 17, 2008 at 9:26 AM, Jim White <ji...@pagesmiths.com> wrote:
> 
>>I'll try this again without the long folksy preliminaries (see copied
>>below).
>>
>>I need to get an artifact that uses a M2 classifier.  How do I do that
>>using the Ivy Ant tasks?
> 
> Have you seen my answer to your original e-mail? I posted it some minutes
> later you posted this question again. Does it answer your question?

Yes indeed!

I had just noticed you answering later questions and thought you might 
have missed the actual question in my original post.

Thank you very much!

Jim


Re: How use a classifier with the Ant tasks? (was Re: Classifier frustration)

Posted by Xavier Hanin <xa...@gmail.com>.
On Thu, Apr 17, 2008 at 9:26 AM, Jim White <ji...@pagesmiths.com> wrote:

> I'll try this again without the long folksy preliminaries (see copied
> below).
>
> I need to get an artifact that uses a M2 classifier.  How do I do that
> using the Ivy Ant tasks?

Have you seen my answer to your original e-mail? I posted it some minutes
later you posted this question again. Does it answer your question?

Xavier

>
>
> Thanks!
>
> Jim
>
> Jim White wrote:
>
>  Hello Xavier and friends!
> >
> > I've been lurking around Ivy for a long while and am glad to see it
> > close to being released as Apache Ant software.
> >
> > Today I tried to sort out a problem someone was having using JSON-lib
> > with Groovy and ran smack into a M2 classifier.  So I workaround it sort of
> > this way:
> >
> > XWINGS.IVY {
> >   info(organisation:"org.ifcx", module:"WingsIvyTest")
> >   dependencies {
> >       dependency(org:'net.sf.json-lib', name:'json-lib', rev:'2.2.1'
> >                  , conf:'default->runtime') {
> >           artifact(name:'json-lib', type:'jar',
> > url:'
> > http://repo1.maven.org/maven2/net/sf/json-lib/json-lib/2.2.1/json-lib-2.2.1-jdk15.jar')
> >
> >       }
> >   }
> > }
> >
> > Naturally that is not so satisfying, so then I see this ("Re: How can I
> > retrieve binary files and source files in one shot"):
> >
> > http://marc.info/?l=ivy-user&m=119939232121568&w=2
> >
> > which makes me think, Aha! but alas no joy because if I try to make an
> > Ivy like that I get:
> >
> > XWINGS.IVY {
> >   info(organisation:"org.ifcx", module:"WingsIvyTest")
> >   dependencies {
> >       dependency(org:'net.sf.json-lib', name:'json-lib', rev:'2.2.1',
> > conf:'default->runtime') {
> >           artifact(name:'json-lib', type:'jar', classifier:'jdk15')
> >       }
> >   }
> > }
> > : syntax errors in ivy file: java.text.ParseException: [xml parsing:
> > file:/tmp/ifcx-wings-ivy-23918.xml:5:65: cvc-complex-type.3.2.2: Attribute
> > 'classifier' is not allowed to appear in element 'artifact'. in
> > file:/tmp/ifcx-wings-ivy-23918.xml
> > ]
> >
> > Same problem if I try that in 'dependency'.  I look into the ivy.xsd in
> > SVN and see that indeed there is no 'classifier' anywhere, nor is there in
> > the related Java files.
> >
> > I then find the ResolveTest.java code which uses a classifier in a POM
> > which it hands off to ivy.resolve(File), and so I think Aha! again and set
> > about trying to give the Ivy Ant resolve task a POM, but that doesn't seem
> > to be working out either, although perhaps I just need to do further
> > debugging.
> >
> > Is it possible to use a POM with the Ivy Ant tasks?  What do I need to
> > do to use a classifier from the Ant tasks?  It's possible I could use the
> > Ivy Java API, but I'm trying to avoid tying my implementation too closely to
> > Ivy's internals and Ant tasks are preferred.
> >
> > Thanks in advance for any pointers.
> >
> > And if you want to get a peek at Ivy integrated with Groovy inside
> > OpenOffice, you can try it out here:
> >
> > http://www.ifcx.org/
> >
> > It's the "IFCX Wings" literate scripting document that is enabled by
> > GroovyForOpenOffice, but you can just look at the document without using
> > G4OO for the macro.
> >
> > Jim
> >
> >
> >
>


-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/