Sle*_*led 3 maven jaxb2-maven-plugin
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.
是的,您可以使用Properties Maven插件使用将在此阶段设置的set-system-properties目标.initialize
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>properties-maven-plugin</artifactId>
    <version>1.0.0</version>
    <executions>
        <execution>
            <goals>
                <goal>set-system-properties</goal>
            </goals>
            <configuration>
                <properties>
                    <property>
                        <name>javax.xml.accessExternalSchema</name>
                        <value>all</value>
                    </property>
                </properties>
            </configuration>
        </execution>
    </executions>
</plugin>
| 归档时间: | 
 | 
| 查看次数: | 1783 次 | 
| 最近记录: |