users@jaxb.java.net

RE: Re: JAXB Plugin

From: <HeruMartinus.Salim_at_infineon.com>
Date: Fri, 10 Nov 2006 13:21:02 +0100

Hi,

Thanks lexi.
I've refined my work.
Now I'm trying to create my "dummy plugin" which the content is just the
same as code injector, just adding a line of println inside the run
method of the PluginImpl class.

Here are my steps:
1. Add the line "System.out.println("A");" inside method run of
PluginImpl.java
2. Change the getNameOption to returning String "inject-code"
3. change the package name to "package mycodeinjector", also the in file
Const.java
4. Save the file inside folder mycodeinjector
5. I compiled it.
6. Adding line "mycodeinjector.PluginImpl" in file
META-INF/services/com.sun.tools.xjc.Plugin
7. Creating the jar files using command
        jar -cf plugin.jar META-INF mycodeinjector/*.class
8. Change the build file to use argument of "-inject-code"

Now it cause error message, "unrecognized parameter -inject-code"
Even when I change the build file to use argument of "-Xinject-code",
which did work, it showed an error message of "unrecognized parameter
-Xinject-code"

What is my mistake right here?
Thanks.
Heru

-----Original Message-----
From: Aleksei Valikov [mailto:valikov_at_gmx.net]
Sent: Friday, November 10, 2006 11:31 AM
To: users_at_jaxb.dev.java.net
Subject: Re: JAXB Plugin

Hi.

> Sorry,
>
> I found my problem.
> The file
> /META-INF/services/com.sun.tools.xjc.Plugin in jaxb-xjc.jar doesn't
> contains the line com.sun.tools.xjc.addon.code_injector.PluginImpl
>
> When I add it, and some changes on the build.xml, it works.
>
> Thanks a lot for the help, and for the blogs (of Hanson and Kohsuke)

You should add this line in /META-INF/services/com.sun.tools.xjc.Plugin
in your jar. You should not patch jaxb-xjc.jar.

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