I wasn't able to subscribe or submit to
[EMAIL PROTECTED] - I don't think I was doing
anything stupid - I received 'Unrouteable address' errors.

Anyway, both David O'Flanagan and myself have been using JAXB and I
thought I'd send you the latest & greatest (mostly David's work) which
you might want to use to update the jaxb plugin on sourceforge. It adds
an extra parameters to give it more flexibility, e.g. on the package for
the generated classes. Plus comments for JAXB 1.5.


<project xmlns:j="jelly:core" xmlns:util="jelly:util"
xmlns:maven="jelly:maven" xmlns:ant="jelly:ant">
  <!-- 
  If there are any schemas to be compiled with JAXB in any 
  of the CORE sub-projects then this goal will pick it up 

  Required properties:
  ct.jaxb.schemas - space separated list of schemas
  ct.jaxb.src.dir - directory where schemas+bindings exist
  ct.jaxb.package.name - root package name

  Dependencies: 
  it is v. important to take the dependencies from Sun's 
  JWSDP 1.5 bundle. Otherwise it is easy to confuse the jars from Sun
and Apache, 
  which will cause JAXB to break.

  More info on the xjc implementation:
  http://java.sun.com/webservices/docs/1.5/jaxb/ant.html
  -->
  <preGoal name="java:compile">
    
    <ant:mkdir dir="${maven.build.dir}/jaxb"/>
    
    <ant:taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
      <ant:classpath>
        <ant:pathelement
location="${pom.getDependencyPath('jaxb:jaxb-api')}"/>
        <ant:pathelement
location="${pom.getDependencyPath('jaxb:jaxb-xjc')}"/>
        <ant:pathelement
location="${pom.getDependencyPath('jaxb:jaxb-libs')}"/>
        <ant:pathelement
location="${pom.getDependencyPath('jaxb:jaxb-impl')}"/>
        <ant:pathelement
location="${pom.getDependencyPath('jwsdp-shared:xsdlib')}"/>
        <ant:pathelement
location="${pom.getDependencyPath('jwsdp-shared:relaxngDatatype')}"/>
        <ant:pathelement
location="${pom.getDependencyPath('jwsdp-shared:jax-qname')}"/>
        <ant:pathelement
location="${pom.getDependencyPath('jwsdp-shared:namespace')}"/>
        <ant:pathelement
location="${pom.getDependencyPath('jwsdp-shared:jwsdp-shared')}"/>
        <ant:pathelement
location="${pom.getDependencyPath('jaxp:jaxp-api')}"/>
        <ant:pathelement
location="${pom.getDependencyPath('jaxp:xercesImpl')}"/>
        <ant:pathelement
location="${pom.getDependencyPath('jaxp:xalan')}"/>
      </ant:classpath>
    </ant:taskdef>

    <util:tokenize var="schemas" delim="
">${ct.jaxb.schemas}</util:tokenize>
    
    <j:forEach var="schema" items="${schemas.iterator()}">
      
      <!-- need to check if props are set -->
      <maven:param-check value="${ct.jaxb.src.dir}" fail="true">
        Please make sure that ct.jaxb.src.dir is set.
      </maven:param-check>
      
      <maven:param-check value="${ct.jaxb.package.name}" fail="true">
        Please make sure that ct.jaxb.package.name is set.
      </maven:param-check>
    
      <xjc target="${maven.build.dir}/jaxb" 
        binding="${ct.jaxb.src.dir}/${schema}.xjb" 
        schema="${ct.jaxb.src.dir}/${schema}.xsd" 
        removeOldOutput="true"
        package="${ct.jaxb.package.name}.${schema}">
          <produces dir="${maven.build.dir}/jaxb"
includes="**/${schema}/**/*.*"/>
      </xjc>
    </j:forEach>
    
  </preGoal>

</project>

http://www.bbc.co.uk/

This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated.
If you have received it in error, please delete it from your system. 
Do not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately. Please note that the
BBC monitors e-mails sent or received. 
Further communication will signify your consent to this.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to