java - Eclipse Maven 构建问题 : Failed to compile input schema(s)!

标签 java eclipse maven m2e jaxb2

我的 Eclipse 似乎遇到了 Maven 问题。我的 Juno eclipse 版本中有 eclipse 插件 m2e 和 Egit,它们是最新的。顺便说一句,它确实可以在 eclipse 和 DOS mvn 中编译良好 - 但 eclipse 仍在记录该问题。

有问题的 pom.xml 部分

<plugin>
   <groupId>org.jvnet.jaxb2.maven2</groupId>
   <artifactId>maven-jaxb2-plugin</artifactId>
   <version>0.8.3</version>
   <configuration>
      <catalog>src/main/resources/my-model.cat</catalog>
   </configuration>
   <executions>
      <execution>           //This is being highlighted as an error
         <id>generate-sources</id>
         <phase>generate-sources</phase>
         <goals>
            <goal>generate</goal>
         </goals>
         <configuration>
            <schemaDirectory>src/main/resources</schemaDirectory>
               <schemaIncludes>
                  <!-- <include>a.xsd b.xsd c.xsd</include> -->
                  <include>*.xsd</include>
               </schemaIncludes>
         <forceRegenerate>true</forceRegenerate>
         <writeCode>true</writeCode>
         <episode>true</episode>
         <episodeFile>${project.build.directory}/generate-sources/xjc/META-INF/my-model.episode</episodeFile>
         </configuration>
      </execution>
   </executions>
</plugin>

但是我遇到了一个问题:

Failed to compile input schema(s)! Error messages should have been provided.
(org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.8.3:generate:generate-sources:generate-sources)    pom.xml /myProj line 56 Maven Build Problem

这就是我得到的全部 - 只是一个红色恼人的问题,浏览器中突出显示的注释和 pom 文件中的一条波浪线。没有标记架构或其他任何内容。我知道它不会阻止我工作和运行 Maven,但是为什么 Eclipse 和/或 m2e 这样做呢?

谢谢, 凯文

编辑: my-model.cat 文件

PUBLIC "urn:com:myCom:myProj:model" "a.xsd"
PUBLIC "urn:com:myCom:myProj:operations" "b.xsd"
PUBLIC "urn:com:myCom:myProj:class" "c.xsd"

没有什么太多的。

最佳答案

好的 - 解决了这个问题。看来 m2e 有一些连接器问题。找到这个link这是来自 eclipse 实验室的 m2e-jaxb2-connectors 的 google 代码站点。

将此添加到“安装新软件”区域,此问题和其他问题(其他人不断构建)都消失了。我想这是jaxb开发者必备的插件。

凯文

关于java - Eclipse Maven 构建问题 : Failed to compile input schema(s)!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22106164/

相关文章:

java - 从其他系统java代码运行.bat文件

java - 从 Java 运行 AppleScript 时出现 "is not allowed for assistive access"错误

java - 当其中一个目标使用 java ant 并将 fork 设置为 true 时,如何结束构建过程

java - 使用策略模式发送不同的消息

python - 使用 PyDev 交互式测试 Eclipse 中的代码部分(操作方法和最佳实践)

java - 在 Maven 构建的 EAR 中绑定(bind)文件

java - 根据maven配置文件排除嵌入式服务器

java - 从边界对齐可能不完美的 ByteArray 流中读取字符

java - Dijkstra 的最短路径

java - Eclipse 说 jre 不支持当前编译器级别 1.8 但它设置为 1.7