Java 无法在JDK8上使用org.jvnet.jax-ws-commons.jaxws-maven-plugin
我正在使用org.jvnet.jax-ws-commons:jaxws-maven插件为Soap服务生成客户机存根。升级到JDK8导致此操作失败,出现以下错误:Java 无法在JDK8上使用org.jvnet.jax-ws-commons.jaxws-maven-plugin,java,web-services,maven,soap,jax-rs,Java,Web Services,Maven,Soap,Jax Rs,我正在使用org.jvnet.jax-ws-commons:jaxws-maven插件为Soap服务生成客户机存根。升级到JDK8导致此操作失败,出现以下错误: Failed to read schema document 'xxx.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property. 什么的 Failed to read DTD 'XMLS
Failed to read schema document 'xxx.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.
什么的
Failed to read DTD 'XMLSchema.dtd', because 'file' access is not allowed due to restriction set by the accessExternalDTD property.
这是为什么?我如何解决这一问题?JDK8中的默认限制似乎已更改 我们发现: 然而,我很难找到如何将其应用于Maven插件,但传递jvm参数起到了作用:
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>${jaxws.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<verbose>true</verbose>
<xdebug>true</xdebug>
<wsdlDirectory>${basedir}/src/main/wsdl/</wsdlDirectory>
<wsdlFiles>
<wsdlFile>foo.wsdl</wsdlFile>
</wsdlFiles>
<vmArgs>
<vmArg>-Djavax.xml.accessExternalDTD=all</vmArg>
<vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
</vmArgs>
</configuration>
</execution>
</executions>
</plugin>
org.jvnet.jax-ws-commons
jaxws-maven插件
${jaxws.plugin.version}
wsimport
真的
真的
${basedir}/src/main/wsdl/
foo.wsdl
-Djavax.xml.accessExternalDTD=all
-Djavax.xml.accessExternalSchema=all