Update.

Well I got things working running as an ant task. However, I wanted to have a cleaner code base so I decided to work on building a maven plugin. It appears that I may have discovered a bug (or lack of knowledge on my behalf). Here is what my plugin is doing

CodeGenCommandLine cmdLine = new CodeGenCommandLine();
cmdLine.processArgs(args)
CodeGen codegen = new CodeGen(cmdLine);
codegen.generate(true);

I am getting a null pointer exception on the generate call. Here is the stack trace.

java.lang.NullPointerException
        at org.jibx.schema.codegen.CodeGen.generate(CodeGen.java:1388)

Looking at the source it appears that m_packageDirectory is null as its not being set. In the source it only appears that m_packageDirectory is getting set in the load method which is private and only called by the main method (which is why it works from the command line and not from a codeGen.generate). Any way of getting a patch?? :)

Also developing a plugin has proven difficult as the tools and schema jars aren't on the central maven repository.

Thanks

Ken

Date: Sun, 19 Apr 2009 20:44:02 +1200
From: Dennis Sosnoski <d...@sosnoski.com>
Subject: Re: [jibx-users] Maven bind using schema
To: JiBX users <jibx-users@lists.sourceforge.net>
Message-ID: <49eae452.3080...@sosnoski.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Ken,

I don't think anyone has written a maven plugin for this purpose yet. If
you understand how maven works (I don't, much) you might be able to
write such a plugin yourself. Otherwise, perhaps someone else on the
list is doing something of this type?

 - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Ken Preudhomme wrote:
Hello,

I have a maven project in which I am currently using binding files and
java code to map XML to some java objects. However, I received a
requirement to instead of Java/Bind files to use an XSD. I see the
documentation on how to use the schema (using ant and from the command
line), but I cannot find documentation on how to perform the same
thing from maven. Can someone point me in the right direction?

Thanks

Ken

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to