当我尝试在java 7中使用maven-jaxb-schemagen-plugin时
<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<version>1.2</version>我得到一个错误:
[ERROR] Failed to execute goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate (default) on project TopologyProvisionerDom: Execution default of goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate failed: A required class was missing while executing com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate: com/sun/mirror/apt/AnnotationProcessorFactoryAnnotationProcessorFactory似乎在Java7中被移除/弃用了?有没有可能使用这个插件让jaxb schemagen工作?在使用JDK 7时,有没有其他方法可以从JAXB源代码生成模式?
发布于 2011-12-14 01:38:06
您是否尝试过使用org.codehaus.mojo:jaxb2-maven-plugin?
发布于 2012-08-02 23:22:08
它是这样工作的(将此配置文件添加到您的pom.xml中):
<profile>
<id>jdk7-fix</id>
<activation>
<file><exists>${java.home}/../lib/tools.jar</exists></file>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>发布于 2015-09-24 13:58:07
不知道还有没有人在听这个帖子,但是,嘿...
我使用了transformSchemas选项,例如
<transformSchemas>
<transformSchema>
<uri>YOUR NS IN YOUR GENERATED SCHEMA FILE</uri>
<toFile>DESIRED NAME OF YOUR XSD FILE</toFile>
</transformSchema>
</transformSchemas>干杯
-m。
https://stackoverflow.com/questions/8493233
复制相似问题