我有一个基于maven的构建脚本,它运行jaxb2-maven-plugin(schemagen)来从Java类生成XSD。我做错了什么,它不会产生它。
项目非常复杂,很难在控制台中重新创建确切的命令行。
在我的.pom文件中,我只有
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>schemagen</id>
<goals>
<goal>schemagen</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**/*.java</include>
</includes>
</configuration>
</plugin>
我可以使用哪些选项来命令schemagen / plugin来显示控制台上出错的原因?
答案 0 :(得分:0)
回答您的问题
请找到域对象用户,我已生成XSD架构。
/**
*
*/
package com.example;
/**
* @author Praveen
*
*/
public class User {
private String ename;
private String designation;
public String getEname() {
return ename;
}
public void setEname(String ename) {
this.ename = ename;
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
}
POM文件
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.app</groupId>
<artifactId>sample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>schemagen</id>
<goals>
<goal>schemagen</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**/*.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Maven Goals as
清理安装-e
我的IDE输出,请参考下图。