[英]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.