如何将xsd中的注释添加到jaxb2-maven-plugin生成的java类中?

时间:2015-10-01 12:29:21

标签: java maven xsd jaxb2

同事们,我有xsd架构,其中元素被评论。我使用jaxb2-maven-plugin生成java类。一切都好,但我希望看到来自xsd的评论(例如客户端标识符)。有可能吗?

<xsi:element name="ClID" type="xsi:string">
                    <xsi:annotation>
                        <xsi:documentation>Client identifier.</xsi:documentation>
                    </xsi:annotation>
                </xsi:element> 

更新

在POM中,jaxb2-maven-plugin设置如下:

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                        <phase>generate-sources</phase>
                    </execution>
                </executions>
                <configuration>
                    <clearOutputDir>false</clearOutputDir>
                    <outputDirectory>src/main/java</outputDirectory>
                    <schemaDirectory>src/main/resources/META-INF/schemas</schemaDirectory>
                    <includeSchema>**/*.xsd</includeSchema>
                    <bindingDirectory>src/main/java/com/comp/ddd</bindingDirectory>
                    <enableIntrospection>false</enableIntrospection>
                </configuration>
            </plugin>

0 个答案:

没有答案