无法在JDK8上使用org.jvnet.jax-ws-commons.jaxws-maven-plugin [英] Cannot use org.jvnet.jax-ws-commons.jaxws-maven-plugin on JDK8

查看:636
本文介绍了无法在JDK8上使用org.jvnet.jax-ws-commons.jaxws-maven-plugin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm using org.jvnet.jax-ws-commons:jaxws-maven-plugin to generate client stubs for Soap services. Upgrading to JDK8 made this fail with following error:

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.

这是为什么,我该如何解决?

Why is this and how can I fix this?

推荐答案

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

Seems restriction default have changed in JDK8.

发现了这一点: http://wiki.netbeans.org/FaqWSDLExternalSchema

但是,我很难找出如何将其应用于Maven插件的方法,但是传递jvm参数是可行的:

It was however hard for me to find out how to apply this to the Maven plugin, but passing jvm arguments worked:

 <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>

这篇关于无法在JDK8上使用org.jvnet.jax-ws-commons.jaxws-maven-plugin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆