简体   繁体   English

没有使用Maven插件从xsd生成JAXB类

[英]No JAXB Classes Generated from xsd using Maven Plugin

am not able see any of jaxb classes generated from my xsd using jaxb2-maven-plugin 无法使用jaxb2-maven-plugin从我的xsd生成任何jaxb类

    <bulid>
    <pluginManagement>
    <plugins>
        <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxb2-maven-plugin</artifactId>
        <version>1.5</version>
        <executions>
            <execution>
                <phase>generate-sources</phase>
                <goals>
                    <goal>generate</goal>
                </goals>
            </execution>
        </executions>
        <configuration>

            <schemaDirectory>src/main/xsd</schemaDirectory>
<sourceGenerationDirectory>target/sources</sourceGenerationDirectory>
<classGenerationDirectory>target/classes</classGenerationDirectory>
        </configuration>
        </plugin>
    </plugins>
    </pluginManagement>
    </bulid>
    <dependencies>
    <dependency>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxb2-maven-plugin</artifactId>
        <version>1.5</version>
    </dependency>

and i ran my pom by giving clean install generate:generate is that a correct way ? 我通过提供干净的安装generate:generate来运行pom,这是正确的方法吗? please suggest a way to generate jaxb classes 请提出一种生成jaxb类的方法

i even tried to run by mvn generate-sources nothing is getting generated 我什至试图由mvn generate-sources运行,什么也没有生成

This has worked for me at some point in time; 在某些时候,这对我有用。 you can work from there: 您可以从那里工作:

<plugin>
    <groupId>com.sun.tools.xjc.maven2</groupId>
    <artifactId>maven-jaxb-plugin</artifactId>
    <version>1.1</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <removeOldOutput>false</removeOldOutput>
        <schemaDirectory>src/main/resources/xsd</schemaDirectory>
        <includeBindings>
            <includeBinding>*.xjb</includeBinding>
        </includeBindings>
    </configuration>
</plugin>

The plugin is bound to the generate-sources phase. 该插件绑定到generate-sources阶段。

Cheers, 干杯,

我只是将目标更改为xjc和mvn jaxb2:xjc,它的工作原理是我能够生成生成的jxb类

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用jvnet maven-jaxb2-plugin从类生成XSD - How to generate XSD from classes using jvnet maven-jaxb2-plugin 如何使用通用类从Xsd和Maven生成JAXB - How to generate JAXB from xsd with maven using common classes Java 类不是使用 maven-jaxb2-plugin 从 wsdl 文件生成的 - Java classes are not generated from wsdl file using maven-jaxb2-plugin XSD的JAXB生成的类中的错误 - errors in classes generated by JAXB from XSD XSD文件中的更改从maven-jaxb2-plugin中的maven依赖关系重新生成类 - Regenerate classes after changes in XSD files from maven dependency in maven-jaxb2-plugin 如何使用 gradle 从 WSDL 和 XSD 生成类,相当于 maven-jaxb2-plugin - Howto generate classes from WSDL and XSD with gradle, equivalent to maven-jaxb2-plugin jaxb2-maven-plugin-从类生成xsd时如何关闭递归目录遍历 - jaxb2-maven-plugin - how to turn off recursive directory traversal when generating xsd from classes 使用 JAXB(或其他)从 maven 中的 XSD maven 依赖项生成 Java 类 - Generating Java classes from XSD maven dependency in maven with JAXB (or others) 手动编写的 XSD 和生成的 java 类导致使用 JAXB 的 UnmarshallException - Manually written XSD and generated java classes lead to an UnmarshallException using JAXB XSD - 如何从 JAXB 处理中删除一些生成的多余类? - XSD - how to remove some generated excess classes from JAXB processing?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM