我有一个用 java6 编译的项目。它使用 jaxb2-maven-plugin 为 Web 服务生成 XSD。
我正在尝试将此项目移植到使用 java8 编译/运行。为此,我将 jaxb2-maven-plugin 版本从 1.3.1 升级到 2.2
但是,当我使用“mvn clean install”构建项目时,出现以下错误:
--
[INFO] XSD post-processing: Adding JavaDoc annotations in generated XSDs.
[INFO] Processing [4] java sources.
[ERROR] Execution failed.
[ERROR] [Exception]: java.lang.IllegalArgumentException [Message]: Not supported: indent-number
org.apache.xalan.processor.TransformerFactoryImpl.setAttribute(TransformerFactoryImpl.java:485)
org.codehaus.mojo.jaxb2.schemageneration.XsdGeneratorHelper.getFactory(XsdGeneratorHelper.java:544)
org.codehaus.mojo.jaxb2.schemageneration.XsdGeneratorHelper.getHumanReadableXml(XsdGeneratorHelper.java:440)
org.codehaus.mojo.jaxb2.schemageneration.XsdGeneratorHelper.savePrettyPrintedDocument(XsdGeneratorHelper.java:508)
--
我用谷歌搜索了这个错误,发现这是由于旧的 java6 附带了支持此错误的 xalan 转换器。但是我不确定如何解决这个问题,因为我正在使用插件并且没有在我自己的代码中进行任何转换。
任何帮助表示赞赏。