LaRRy
LaRRy

Reputation: 1

How to make "jaxb2-maven-plugin" to generate WSDL stubs with the same Java class names in both OSs - Windows and Linux?

I have the following XSD schema (which I am not allowed to change):

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="Foo" type="Foo_Type"/>
    <xsd:complexType name="Foo_Type">
    </xsd:complexType>
</xsd:schema>

I am using "jaxb2-maven-plugin" to generate WSDL stubs:

    <build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxb2-maven-plugin</artifactId>
            <version>1.5</version>
            <executions>
                <execution>
                    <id>generate</id>
                    <goals>
                        <goal>xjc</goal>
                    </goals>
                    <configuration>
                        <clearOutputDir>false</clearOutputDir>
                        <extension>true</extension>
                        <bindingDirectory>${basedir}/src/main/resources/jaxb</bindingDirectory>
                        <bindingFiles>simple-binding.xml</bindingFiles>
                        <staleFile>target/generated-sources/jaxb/src/main/java</staleFile>
                        <packageName>foo.bar.gen</packageName>
                        <schemaDirectory>${basedir}</schemaDirectory>
                        <schemaFiles>schema.xsd</schemaFiles>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
    </build>

The resulting Java class I get on my Windows PC is:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Foo_Type")
public class FooType {


}

However those people who use Linux PC get Java class with a different name: Foo.

So it looks like in my Windows PC the Java class name is generated out of "type" element in XSD, while the same Maven configuration in Linux PC generates Java class name out of "element name" element in XSD. The actual XML files have Foo tags, so something seem to be wrong specifically in Windows PC. But I can't understand how to solve this problem.

Are there any suggestions/ideas?

Upvotes: 0

Views: 58

Answers (0)

Related Questions