tl;dr:那么,有没有办法移动-D
系统属性的定义并将其内部化到pom.xml
文件中?
我们目前正在-Djavax.xml.accessExternalSchema=all
从命令行传递mvn clean install -Djavax.xml.accessExternalSchema=all
以使我的构建工作。我无法通过插件(jaxb2-maven-plugin 1.6)中的选项,因为我们使用的版本不支持此功能,并且需要完全更改配置的版本,我们不会获得批准。
尝试通过在标签下添加来设置在<properties>
其他地方建议<project>
的使用标签的值:
<properties>
<javax.xml.accessExternalSchema>all</javax.xml.accessExternalSchema>
</properties>
但我仍然得到一个错误(在下面转载),而通过命令行传递它却没有。
Caused by: org.xml.sax.SAXParseException;
systemId: jar:file:/e:/apache/maven/.m2/repository/com/sun/xml/bind/jaxb-xjc/2.2.7/jaxb-xjc-2.2.7.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd;
lineNumber: 52; columnNumber: 88; schema_reference:
Failed to read schema document 'xjc.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.