You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Paul Spencer <pa...@mindspring.com> on 2003/02/28 03:19:28 UTC

Castor plugin problems

I have the following request, question, and contribution around the 
castor plugin.

1) Please update the dependency for the plugin to castor.jar
    version 9.4.3.  Version 9.4 displays the following error
    when "type" is "j2"

- invalid option for types: org.exolab.castor.builder.FieldInfoFactoryJ2
java.lang.NullPointerException


2) Castor has some additional arguments, like -testing and -verbose,
    that I would like to use, in addition to not using -nomarshall.  Is
    their a way to place IF logic around an <arg> tag in the <java> tag.
    This would allow 1 <java> tag instead of 2**(number of optional
    arguments).

    <java classname="org.exolab.castor.builder.SourceGenerator"
          failonerror="true">
      <arg ....>
      <if test="${enableTesting}}">
        <arg value="-testing"/>
      </if>
      <arg ....>
    </java>


3) You may use the following example in the plugin documentation.  I
    have it in my maven.xml:

   <!-- The following goal, myGoal:srcgen, will generate java source
        files in the src/java/org/foo/om/generated directory using the
        src/xml/castor-mapping.xml file as the castor mapping file.  This
        goal is executed with the command:
              maven myGoal:srcgen
   -->
   <goal name="myGoal:srcgen">
     <castor:srcgen
        schema="src/xml/castor-mapping.xml"
        package="org.foo.om.generated"
        types="j2"
        generationDirectory="src/java"
      />
   </goal>

   <!-- Regenerate the file on a clean -->
   <postGoal name="clean"?
     <attainGoal name="myGoal:srcgen"/>
   </postGoal>

Thank you

Paul Spencer



Re: Castor plugin problems

Posted by Jason van Zyl <ja...@zenplex.com>.
On Thu, 2003-02-27 at 21:19, Paul Spencer wrote:
> I have the following request, question, and contribution around the 
> castor plugin.

Cool, thanks. I'll work on this as I use Castor on a daily basis and
have all sorts of snippets lying around that I haven't committed.


-- 
jvz.

Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society