maven clean install因XJC错误而失败

时间:2017-02-27 10:23:03

标签: java maven xsd xjc

在使用 mvn clean install 构建项目时,我收到了XJC(从XSD生成源代码)错误。奇怪的是,当在其他机器中构建相同的代码时,同样的代码变得成功并且源从XSD生成。下面是例外情况,我正在接受。

Downloaded: https://repo.maven.apache.org/maven2/com/sun/xml/bind/jaxb-xjc/2.1.13/jaxb-xjc-2.1.13.jar (3031 KB at 27.0 KB/sec)
[INFO] Generating source...
[INFO] parsing a schema...
[ERROR] file:/home/proj-app/message-converter/msg-cnvrtr-domain/src/main/resources/MSG-CNVRTR-DB.xsd[133,60]
org.xml.sax.SAXParseException; systemId: file:/home/proj-app/message-converter/proj-domain/src/main/resources/MSG-CNVRTR-DB.xsd; lineNumber: 133; columnNumber: 60; src-resolve: Cannot resolve the name 'msg:ChannelType' to a(n) 'type definition' component.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4156)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:4139)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getGlobalDecl(XSDHandler.java:1745)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDElementTraverser.traverseNamedElement(XSDElementTraverser.java:405)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDElementTraverser.traverseLocal(XSDElementTraverser.java:194)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.traverseLocalElements(XSDHandler.java:3612)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:636)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:613)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:572)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:538)
at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:255)
at com.sun.tools.xjc.reader.xmlschema.parser.SchemaConstraintChecker.check(SchemaConstraintChecker.java:101)
at com.sun.tools.xjc.ModelLoader.loadXMLSchema(ModelLoader.java:357)
at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:167)

我想这是我的环境设置的一些问题,因为在其他机器上编译也是如此。有人可以对此有所了解吗?

0 个答案:

没有答案