不能在JDK8上使用org.jvnet.jax-ws-commons.jaxws-maven-plugin

Vik*_*alk 9 java soap web-services jax-rs maven

我正在使用org.jvnet.jax-ws-commons:jaxws-maven-plugin为Soap服务生成客户端存根.升级到JDK8使此失败,并出现以下错误:

Failed to read schema document 'xxx.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.
Run Code Online (Sandbox Code Playgroud)

和类似的东西

Failed to read DTD 'XMLSchema.dtd', because 'file' access is not allowed due to restriction set by the accessExternalDTD property.
Run Code Online (Sandbox Code Playgroud)

为什么这样,我该如何解决这个问题?

Vik*_*alk 26

JDK8中的似乎限制默认值已更改.

发现这个:http://wiki.netbeans.org/FaqWSDLExternalSchema

然而,我很难找到如何将它应用于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>
Run Code Online (Sandbox Code Playgroud)