users@jaxb.java.net

Re: simple question

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 31 Mar 2006 12:06:22 -0800

jason white wrote:
> Kohsuke,
>
> Finally got a chance to loop back to this and create a super-simple solution
> to see if I can call the jar from the command line. Looks like I still
> cannot do that. My new jar does not have any dependencies to other foreign
> jars or anything either.
>
> Please take a moment and look at my jar file attached and see if you can get
> it to run. Please also indicate what you do/run to make it work from the
> command line.

This works for me:

> % ./xjc.sh -cp ../../sandbox/simpleplugin.jar -help
> Usage: xjc [-options ...] <schema file/URL/dir> ... [-b <bindinfo>] ...
> Options:
> -nv : do not perform strict validation of the input schema(s)

    <snip />

> Extensions:
> -Xlocator : enable source location support for generated code
> -Xsync-methods : generate accessor methods with the 'synchronized' keyword
> -mark-generated : mark the generated code as @javax.annotation.Generated
> -Xsimple : adds public void helloWorld()

Have you tried com.sun.tools.xjc.Options.findServices=true?

IOW,

> % java -Dcom.sun.tools.xjc.Options.findServices=true -jar jaxb-xjc.jar -cp ../../sandbox/simpleplugin.jar -help
> Usage: xjc [-options ...] <schema file/URL/dir> ... [-b <bindinfo>] ...
> Options:
> -nv : do not perform strict validation of the input schema(s)

    <snip />

>
> Looking for META-INF/services/com.sun.tools.xjc.Plugin for add-ons
> Checking jar:file:/C:/kohsuke/Sun/JAXB/jaxb-ri/dist/lib/jaxb-xjc.jar!/META-INF/services/com.sun.tools.xjc.Plugin for an add-on
> Attempting to instanciate com.sun.tools.xjc.addon.locator.SourceLocationAddOn
> Attempting to instanciate com.sun.tools.xjc.addon.sync.SynchronizedMethodAddOn
> Attempting to instanciate com.sun.tools.xjc.addon.at_generated.PluginImpl
> Checking jar:file:/c:/kohsuke/Sun/jaxb/jaxb-ri/sandbox/simpleplugin.jar!/META-INF/services/com.sun.tools.xjc.Plugin for an add-on
> Attempting to instanciate com.hb.jaxb.xjc.plugins.SimpleInlinePlugin
>
> Extensions:
> -Xlocator : enable source location support for generated code
> -Xsync-methods : generate accessor methods with the 'synchronized' keyword
> -mark-generated : mark the generated code as @javax.annotation.Generated
> -Xsimple : adds public void helloWorld()

?

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com