users@jaxb.java.net

Re: JAXB compilation plugin

From: William Simons <william.simons_at_childrens.harvard.edu>
Date: Mon, 13 Feb 2006 09:55:58 -0500

Could you use the geronimo-spec activation jar instead? That is available
on ibiblio at

https//ibiblio.org/maven2/geronimo-spec/geronimo-spec-activation/1.0.2-rc4/





On 2/13/06 12:24 AM, "Jonathan Johnson" <jonjohnson_at_mail.com> wrote:

> javax/xml/stream/XMLStreamException
>
> is part of JSR-173 StAX API and only the pom is in the Maven 2 ibiblio
> repository. Both activation.jar and jsr173_api.jar are not in the
> repository, only their poms.
>
> It appears the only way to get jsr173_api.jar is to performs a relatively
> long, complex installation the Web Services pack, (yuck). Once I point to
> C:\Sun\jwsdp-2.0\sjsxp\lib\jsr173_api.jar the jaxb generator worked.
>
> Without resolving these technical barriers people will avoid using this
> plugin.
>
> Is it true JAXB requires J2EE or the Web Services pack? For common XML
> streaming with beans Castor would seem to be easier choice for J2SE
> projects. There are many plain old java applications that use XML but do
> not want to depend on the complexities of jars from Web Services or J2EE or
> the licensing terms they incur.
>
>>> Any plan to commit this in the repository? You don't have to wait for it
>>> to complete.
>
> I'll clean it up and post it this week.
>
>
> -----Original Message-----
> From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
> Sent: Friday, February 10, 2006 1:20 PM
> To: users_at_jaxb.dev.java.net
> Subject: Re: JAXB compilation plugin
>
>
> Jonathan Johnson wrote:
>> I resolved this one by downloading activation.jar (had to do it manually
> as
>> Sun does not appear to permit automatic Maven 2 downloads, this is not
>> good). After adding activation.jar to the repository the domino falls to
>> this...
>
> Ah, yes. JAXB2 API depends on a few other jars.
>
> My understanding of the license is that it's OK to put those into a
> Maven repository, as a part of your program (namely the plugin.) See
>
> * License to Distribute Software. ... Sun
> grants you ... license to reproduce and distribute the
> Software in binary code form only, provided that
> you ... distribute the Software complete and
> unmodified and only bundled as part of your
> Programs,
>
> So I guess that means you can't just redistribute this jar alone, but as
> long as it's with other jars, it should be OK. In other words, I think I
> can put this under the JAXB groupId. Not that it's ideal, but it should
> work.
>
> I'll ask internally, too.
>
>
>> java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
>> at
>>
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.createUnmarshaller(JAXBContextIm
>> pl.java:607)
>>
>> Why are these extra jar(s) needed? The pom.xml is attached to show the
>> current dependencies...
>
> This is JSR-173 StAX API. The reason why we need those jars is because
> JAXB API jar requires them. The reason why the API jar requires them is
> because we (and the expert group) felt that it will improve the usability.
>
> I think JSR-173 is on a Maven repository somewhere.
>
>>
>> Standard po schema is attached (I suspect its fine). The code is...
>>
>> XJC2Mojo xjc2Mojo = new XJC2Mojo(); // Derives from XJC2Task to
>> resolve logging differences
>> xjc2Mojo.setLogger(log);
>> xjc2Mojo.setProject(new Project());
>> xjc2Mojo.setDestdir(targetDirFile);
>> xjc2Mojo.setSchema(schema);
>> xjc2Mojo.execute(); // <-- throws class not found errors.
>
> That's a good progress. Cool!
>
> Any plan to commit this in the repository? You don't have to wait for it
> to complete.
>
>>
>> -----Original Message-----
>> From: Kohsuke Kawaguchi [mailto:kohsuke.kawaguchi_at_sun.com]
>> Sent: Thursday, February 09, 2006 1:04 AM
>> To: users_at_jaxb.dev.java.net
>> Subject: Re: JAXB compilation plugin
>>
>>
>> Jonathan Johnson wrote:
>>> XJC2Task will not work because the code is tightly bound to the Ant
>> classes
>>> (see XJC2Task.getProject()).
>>
>> Yes, you are right that it's written for Ant.
>>
>> But on the other hand, it's surprisingly easy to drive Ant from any Java
>> program. For example, in one of my hobby project Hudson, I use Ant's
>> copy task [1]. Maven1 did it all the time (through Jelly.)
>>
>> So I think it's still possible to do this.
>>
>>> There are two Driver classes, I'm unclear on the difference between the
>> two
>>>
>>> com.sun.tools.xjc.api.Driver
>>> com.sun.tools.xjc.Driver
>>>
>>> In conclusion, I found that
>>>
>>> com.sun.tools.xjc.Driver.run(String[] args, XJCListener listener)
>>>
>>> will probably work the best.
>>
>> That said, I think this method would be also just fine.
>>
>> I'd mildly prefer for you to use the XJC2Task, because of the nice XML
>> syntax it already offers, but that's more complicated.
>>
>> So I think your pick is sound --- and once you get started, and if you
>> are interested, perhaps I could help to hook up XJC2Task into the maven
>> plugin.
>>
>>
>> [1]
>>
> https://hudson.dev.java.net/source/browse/hudson/hudson/src/hudson/tasks/Art
>> ifactArchiver.java?rev=1.2&view=markup
>> --
>> Kohsuke Kawaguchi
>> Sun Microsystems kohsuke.kawaguchi_at_sun.com
>>
>>
>> ------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
> --
> Kohsuke Kawaguchi
> Sun Microsystems kohsuke.kawaguchi_at_sun.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>