代码之家  ›  专栏  ›  技术社区  ›  raoulsson

Maven Webservice插件使用install,而不是deploy

  •  0
  • raoulsson  · 技术社区  · 15 年前

    我有一个使用插件的maven模块 jaxws-maven-plugin . 我已经启动并运行了Web服务,当浏览到 .../myWebservice?wsdl ,我得到了WSDL。没问题。

    在运行 wsimport maven目标通过:

    <plugin>
    <groupId> org.codehaus.mojo </groupId>
    <artifactId> jaxws-maven-plugin </artifactId>
    <executions>
    <execution>
    <goals>
    <goal> wsimport </goal>
    </goals>
    </execution>
    </executions>
    <configuration>
    <sourceDestDir> src/main/java </sourceDestDir>
    <wsdlUrls>
    <wsdlUrl> http://host/f/soap/fWeb?wsdl </wsdlUrl>
    </wsdlUrls>
    </configuration>
    </plugin>

    mvn clean install

    一切都很好。。。但是,当我跑步的时候它不起作用

    mvn clean deploy

    [INFO] jaxws:wsimport args: [-s, D:\works2\f-service\src\main\java, -d, D:\works2\f- service\target\classes, -Xnocompile, http://host/f/soap/fWeb?wsdl] parsing WSDL...

    在一个非常长的超时之后,感觉像是http超时,它将失败,并显示以下消息:

    [ERROR] Unexpected end of file from server Failed to read the WSDL document: http://host/f/soap/fWeb?wsdl , because
    1) could not find the document;
    2) the document could not be read;
    3) the root element of the document is not wsdl:definitions.
    ERROR failed.noservice=Could not find wsdl:service in the provided WSDL(s): At least one WSDL with at least one service definition needs to be provided. Failed to parse the WSDL.

    <definitions> ,不是 <wsdl:definitions> ,但为什么它能与 mvn清洁安装


    拉乌尔

    1 回复  |  直到 15 年前
        1
  •  1
  •   Pascal Thivent    15 年前

    实际上,我不知道为什么 mvn clean install mvn clean deploy 没有一致的结果。第一, wsimport 被绑定到 generate-sources 在这两种情况下执行的时间都要早得多。其次是 deploy 紧接着发生的阶段 install

    在集成或发布环境中完成,将最终包复制到远程存储库,以便与其他开发人员和项目共享。

    所以,真的,我看不出将工件复制到存储库会有什么影响 或者使构建在与WSDL相关的东西上失败。非常非常奇怪。也许跑吧 mvn -X clean deploy 看看你能不能得到更多的信息。

    第一个是 在中生成源 src/main/java target 目录,以便在 clean ${project.build.directory}/jaxws/wsimport/java ${project.build.directory}/generated-sources/jaxws 相反(这是生成内容的标准maven模式)。但这只是一个旁注,这不会解决您的问题:)

    <wsdlUrls> <wsdlurl> src/wsdl (或其他位置,在这种情况下,必须使用 <wsdlLocation> 元素)。这将有助于解决超时问题。