users@jaxb.java.net

ant XJCTask: How to set the working directory (basedir)?

From: Jan Gramberg <jg_at_SYRACOM.DE>
Date: Thu, 17 Jul 2003 00:33:42 -0600

Sorry for the duplicate posting. Problem with the web frontend. Here is my complete Message:

As described in the documentation for the ant task (http://java.sun.com/webservices/docs/1.2/jaxb/ant.html), there is no attribute "basedir" for XJCTask.

I have to set the working directory for my XJCTask. This directory is not the same directory as defined by the basedir-attribute of <project>. Any ideas, how I could achieve this with ant?

My Reason for setting the working directory: In the schema-file "schema.xsd" are <xs:import> and <xs:include>-statements relative to the position of schema.xsd in the filesystem, which I can't change. This position is NOT the directory <project basedir/>.

Example:
+-Myprojectdir
  +-Sources
  +-XMLSchema
    +-Service
      +-MyService
    +-types
      +- ...

schema.xsd is in "MyService". It contains statements like
<xsd:import namespace="http://domain.com/types/2003/1" schemaLocation="../types/2003/1/types.xsd"/>

Any suggestions, how I could compile this type of schema files with the ant task?

Jan