[英]jaxb2-maven-plugin to report problems on Console
I have a maven-based build script that runs jaxb2-maven-plugin (schemagen) to generate XSD from Java classes. 我有一个基于Maven的构建脚本,该脚本运行jaxb2-maven-plugin(schemagen)从Java类生成XSD。 I have done something wrong and it won't generate it. 我做错了什么,它不会生成它。
The project is very complex and it is difficult to re-create in console the exact command line. 该项目非常复杂,很难在控制台中重新创建确切的命令行。
In my .pom file I just have 在我的.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>
What options I may use to command schemagen / plugin to show what was the cause of error on console? 我可以使用哪些选项来命令schemagen / plugin以显示控制台错误的原因?
Answer to your question 回答你的问题
Please find the Domain Object user and I have generated XSD schema. 请找到域对象用户,并且我已经生成了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 file 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 Maven目标为
clean install -e 全新安装-e
Output on my IDE, please refer below figure. 我的IDE上的输出,请参考下图。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.