Maven JAXB 2.1 errors while generating code with multiple XSD inputs
--------------------------------------------------------------------
Key: MJAXB-38
URL: http://jira.codehaus.org/browse/MJAXB-38
Project: Maven 2.x JAXB 2.1 Plugin
Issue Type: Bug
Environment: RSA 7.5, Windows / Linux
Reporter: Anusch A.-Rabii
Hello everyone,
We have some problems with the Maven JAXB 2.1 plugin while generating Java-Code
from given XSD - files.
The scenario is as follows:
We have to two xsd files, containing request and response structures
respectively, from which we need to generate Java classes.
Both xsd files contain definitions of structures, which are very similar &
share the same typename, e.g. both xsds define an element keyData.
Our idea was to generate sources from these xsds in one-go, but the JAXB plugin
aborts its processing complaining about clashing typenames (s. log)
06.04.11 07:48:55 CEST: [ERROR]
file:/home/m500510/workspace/LAS_HEAD/CTV_FachkomponenteEx_Impl/src/main/xsd/client_request.xsd[24,16]
'keyData' is already defined
06.04.11 07:48:55 CEST: [ERROR]
file:/home/m500510/workspace/LAS_HEAD/CTV_FachkomponenteEx_Impl/src/main/xsd/client_reply.xsd[18,30]
(related to above error) the first definition appears here
Our pom looks like this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>response</id>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<staleFile>${project.build.directory}/generated-sources/jaxb/.staleFlagResponse</staleFile>
<schemaDirectory>src/main/xsd</schemaDirectory>
<schemaFiles>client_reply.xsd</schemaFiles>
<extension>true</extension>
<bindingDirectory>src/main/xjb</bindingDirectory>
<bindingFiles>binding_response.xjb</bindingFiles>
<verbose>true</verbose>
<packageName>de.lvm.ctv.dope.internal.xml.response</packageName>
</configuration>
</execution>
<execution>
<id>request</id>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<staleFile>${project.build.directory}/generated-sources/jaxb/.staleFlagRequest</staleFile>
<schemaDirectory>src/main/xsd</schemaDirectory>
<schemaFiles>client_request.xsd</schemaFiles>
<extension>true</extension>
<bindingDirectory>src/main/xjb</bindingDirectory>
<bindingFiles>binding_request.xjb</bindingFiles>
<verbose>true</verbose>
<packageName>de.lvm.ctv.dope.internal.xml.request</packageName>
</configuration>
</execution>
</executions>
</plugin>
Do you have any idea what we can do about this error?
Is it somehow possible to deactivate these checks?
The XSDs are not our own and we cannot change them (change the namespace or
type definitions) without breaking the compability with the product we are
using.
Cheers,
Anusch A.-Rabii
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email