users@jaxb.java.net

Re: Resolve the schema location from the classpath?

From: Malachi de Ælfweald <malachid_at_gmail.com>
Date: Thu, 31 Jul 2008 07:59:06 -0700

Lexi,

Currently when building, I just have it do all XSDs it finds anywhere in the
src/main/resources tree. Couldn't we just gather all of the physical
locations that are in the buildpath and map them automatically somehow
rather than require it to be maintained in the pom?

Malachi

On Thu, Jul 31, 2008 at 1:07 AM, Aleksei Valikov <valikov_at_gmx.net> wrote:

> Hi.
>
> > thank you. But the context is a little bit different here.
> > I´m using a xjc maven2 plugin, which converts the schemas
> > to java classes.
> > So I have to tell this plugin to resolve the classpath to find
> > the referenced schema.
> > The way to use a xml-catalog works fine, but if I use this
> > way, there´s a file-path-dependency between two projects.
> > So I would like to just configure the classpath to the referenced
> > schema.
>
> I think what's necessary to resolve such tasks is to introduce a
> configurable URI resolver which would be used by XJC when resolving
> schema URIs. Then you could do the following:
>
> * Use the catalog file to map http://www.acme.foo/mySchema.xsd onto
> classpath:/com/acme/foo/MySchema.xsd
> * Configure URI resolver to resolve
> classpath:/com/acme/foo/MySchema.xsd against the classpath into the
> real URI.
>
> I can extend the maven-jaxb2-plugin to support this. However I'd be
> grateful if one of those iterested could put up a test scenario
> together.
>
> Bye.
> /lexi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>