java - Generating XSD from external classes as well without import -
i using com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin
generate xsd file various pojo classes in project. works fine , creates file a.xsd
.
one of files has reference enum external package not control , cannot change. enum doesn't have namespace or sort of annotations specified.
generating works fine generates file a.xsd
namespace , file schema2.xsd
enum, imported in a.xsd
.
for reasons not cover, can have 1 xsd file i need enum generated a.xsd
.
here's pom.xml
code use this:
<plugins> <plugin> <groupid>com.sun.tools.jxc.maven2</groupid> <artifactid>maven-jaxb-schemagen-plugin</artifactid> <version>${maven-jaxb-schemagen-version}</version> <inherited>false</inherited> <executions> <execution> <phase>generate-resources</phase> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <destdir>${basedir}/src/main/resources/xsds</destdir> <srcdir>${basedir}/src/main/java/domain;${basedir}/src/main/java/enums</srcdir> <includes> <include>*.java</include> </includes> <verbose>true</verbose> <schemas> <schema> <namespace>http://www.w3.org/2001/xmlschema/a</namespace> <file>a.xsd</file> </schema> </schemas> </configuration> <dependencies> <dependency> <groupid>javax.xml.bind</groupid> <artifactid>jaxb-api</artifactid> <version>2.2</version> </dependency> <dependency> <groupid>com.sun.xml.bind</groupid> <artifactid>jaxb-xjc</artifactid> <version>2.2</version> </dependency> <dependency> <groupid>com.sun.xml.bind</groupid> <artifactid>jaxb-impl</artifactid> <version>2.2</version> </dependency> <dependency> <groupid>com.sun.xml.bind</groupid> <artifactid>jaxb-xjc</artifactid> <version>2.2</version> </dependency> </dependencies> </plugin> </plugins>
i tried replacing <schema>
this:
<schema> <namespace>*</namespace> <file>a.xsd</file> </schema>
and this:
<schema> <namespace>http://www.w3.org/2001/xmlschema</namespace> <file>a.xsd</file> </schema>
and this:
<schema> <namespace>http://www.w3.org/2001/xmlschema/*</namespace> <file>a.xsd</file> </schema>
i tried adding along 1 specifying a.xsd
:
<schema> <namespace>http://www.w3.org/2001/xmlschema</namespace> <file>a.xsd</file> </schema>
none of above worked.
how can achieve required behavior?
Comments
Post a Comment