Question

I am using the xmlbeans-maven-plugin to generate a number of java beans from a structure of xsd and wsdl documents

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
    <version>2.3.3</version>
</plugin>

I have a number of similarly named elements. The following xsd snippets, from two different files, contains the complexTypes IpType and IPType, amongst others.

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:nmspc1="http://some.system.dk" 
targetNamespace="http://some.system.dk" 
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" > <import namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing"  schemaLocation="http://schemas.xmlsoap.org/ws/2004/08/addressing"/>
<complexType name="IPType" abstract="true">
    <sequence>
        ...
    </sequence>
</complexType>
<complexType name="ExternalType" abstract="true">
    <sequence>
        ...
    </sequence>

and

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    elementFormDefault = "qualified" targetNamespace = "http://www.some.dk"
    version = "20070320"
    xmlns:tns = "http://www.some.dk"
    xmlns:xs = "http://www.w3.org/2001/XMLSchema">
    <xs:element name = "ipHeader" type = "tns:ipHeaderType"/>
    <xs:complexType name = "ipType">
        <xs:sequence>
            ...
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name = "externalType">
        <xs:sequence>
            ...
        </xs:sequence>
    </xs:complexType>
...

This creates the class files IpType and IPType2 for some reason. The plugin enumerates the types as though it is not case sensitive. This is the case for all complexType elements defined in the files that share names, but are distinguished by capital letters.

Now, this would normally not be a problem, as i could just use the correct class and be done with it, but here its gets funny: The generated files differs on different operating systems. On windows (And redhat 6.3) the classes are named

IpType.java
IPType2.java

and on debian:

IPType.java
IpType2.java

(Note the p is capital on the different classes)

This means that the import statements in the java code does not match when the project i built on some systems.

I develop, and build on several different operating systems using Jenkins, so this is a major issue.

So i have three questions: 1. Is there a way to make the plugin name the files differently? 2. Is there a way to make these files independent of the operating system 3. Is there a plugin that will handle this better for me?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top