XSD到Jaxb不生成package-info.java

时间:2013-08-09 14:58:14

标签: maven-2 xsd jaxb2

我有这个示例XSD - 我正在尝试使用Jaxb生成Java classess。 Java类正在生成,但我们没有看到package-info.java类生成,因为package-info.java没有生成编组失败并且QName错误。请帮忙。

<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema  xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"> 
      <xs:element name="Parent">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="testuser"/>
            <xs:element ref="testpassword"/>
            <xs:element minOccurs="0" ref="testname"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="testuser">
        <xs:complexType>
          <xs:attribute name="myname" use="required"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="testpassword">
        <xs:complexType>
          <xs:attribute name="mytestpassword" use="required"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="testname">
        <xs:complexType>
          <xs:attribute name="mytestname" use="required"/>
        </xs:complexType>
      </xs:element>
      </xs:schema>

我的POM.xml:

<plugin>
        <groupId>org.jvnet.jaxb2.maven2</groupId>
        <artifactId>maven-jaxb2-plugin</artifactId>
        <version>0.8.3</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <extension>true</extension>
          <args>
            <arg>-Xannotate</arg>
            </args>
          <plugins>
            <plugin>
              <groupId>org.jvnet.jaxb2_commons</groupId>
              <artifactId>jaxb2-basics</artifactId>
              <version>0.6.4</version>
            </plugin>
            <plugin>
              <groupId>org.jvnet.jaxb2_commons</groupId>
              <artifactId>jaxb2-basics-annotate</artifactId>
              <version>0.6.0</version>
            </plugin>
          </plugins>
          <bindingIncludes>
            <include>sample/test_binding.xml</include>
          </bindingIncludes>
          <schemaIncludes>
            <include>sample.xsd</include>
          </schemaIncludes>
             <generatePackage>com.test</generatePackage>
        </configuration>
      </plugin> 
  </plugins>

绑定文件条目:

<bindings xmlns="http://java.sun.com/xml/ns/jaxb" version="2.1" xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:a="http://abc.dev.java.net">
</bindings>

0 个答案:

没有答案