users@jaxb.java.net

Re: Generate from schemas which resides within jars?

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Thu, 10 Dec 2009 15:47:43 +0100

Hi,

> Is it possible to have JAXB2 generate code from schemas when they are within
> a jar which is on the classpath - or do I have to point to the actual files?

XJC loads schemas via URL, so you can use JAR URL
(jar:file:/c:/almanac/my.jar!/com/acme/foo.xsd) to point to your
schema. You can also use catalog file to remap "public URL" like
http://www.acme.com/foo.xsd onto "system URL" like JAR URL mentioned
above or even use an own catalog resolver.
You can find few hints here:

https://maven-jaxb2-plugin.dev.java.net/docs/guide.html

Bye.
/lexi