tags:

views:

24

answers:

0

There is this schema:

element type="xs:short" name="Status" minOccurs="1" maxOccurs="1"

I miss the required=true from XJC output:

@XmlElement(name = "Status")
protected short status;

But should be:

@XmlElement(name = "Status", required = true)
protected short status;

I generate beans with maven using xjc plugin. POM part is here:

        <plugin>
            <groupId>com.sun.tools.xjc.maven2</groupId>
            <artifactId>maven-jaxb-plugin</artifactId>
            <version>1.1.1</version>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <generateDirectory>src/main/java</generateDirectory>
                <generatePackage>com.mw.cashier.bean</generatePackage>
                <strict>true</strict>
                <verbose>true</verbose>
            </configuration>
        </plugin>

What configuration item I miss?