jaxws-maven-plugin LifecycleExecutionException

问题描述 投票:0回答:1

我的 pom.xml 的这一部分:

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                        <configuration>
                            <verbose>true</verbose>
                            <args>
                                <arg>-b</arg><arg>http://www.w3.org/2001/XMLSchema.xsd</arg>
                                <arg>-b</arg><arg>customization.xjb</arg>
                                <arg>-XtoString</arg> 
                                <arg>-Xequals</arg> 
                                <arg>-XhashCode</arg>
                                <arg>-Xdebug</arg>
                            </args>
                            <wsdlUrls>
                                <wsdlUrl>src/main/resources/ru/vtsft/wsdl/gis-services.wsdl</wsdlUrl>
                            </wsdlUrls>
                            <packageName>ru.vtsft.generated</packageName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

通过这个命令

mvn -e clean install eclipse:clean eclipse:eclipse -DskipTests -Dhttp.proxyHost=192.168.1.254 -Dhttp.proxyPort=3128 -Dhttp.proxyUser=xxx -Dhttp.proxyPassword=xxx > log.txt

我有下一个堆栈跟踪:

[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error executing: wsimport [-s, C:\Documents and Settings\pomeshikov.VTSFT\workspace-web-ins-trunk\web-ins-bundle\export-china\target\jaxws\wsimport\java, -d, C:\Documents and Settings\pomeshikov.VTSFT\workspace-web-ins-trunk\web-ins-bundle\export-china\target\classes, -verbose, -p, ru.vtsft.generated, -Xnocompile, -b, customization.xjb, -XtoString, -Xequals, -XhashCode, -Xdebug, src/main/resources/ru/vtsft/wsdl/gis-services.wsdl]
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing: wsimport [-s, C:\Documents and Settings\pomeshikov.VTSFT\workspace-web-ins-trunk\web-ins-bundle\export-china\target\jaxws\wsimport\java, -d, C:\Documents and Settings\pomeshikov.VTSFT\workspace-web-ins-trunk\web-ins-bundle\export-china\target\classes, -verbose, -p, ru.vtsft.generated, -Xnocompile, -b, customization.xjb, -XtoString, -Xequals, -XhashCode, -Xdebug, src/main/resources/ru/vtsft/wsdl/gis-services.wsdl]
    at org.codehaus.mojo.jaxws.WsImportMojo.wsImport(WsImportMojo.java:294)
    at org.codehaus.mojo.jaxws.WsImportMojo.processWsdlViaUrls(WsImportMojo.java:271)
    at org.codehaus.mojo.jaxws.WsImportMojo.execute(WsImportMojo.java:204)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more

如果我发表评论:

<arg>-b</arg><arg>http://www.w3.org/2001/XMLSchema.xsd</arg>
                                <arg>-b</arg><arg>customization.xjb</arg>

然后 LifeCycleException 没有出现,但我不能这样做,因为在这种情况下插件不会解析 wsdl。

这是对我有用的命令行指令:

wsimport -b http://www.w3.org/2001/XMLSchema.xsd -b customization.xjb gis-services.wsdl -Xnocompile
wsdl maven jax-ws
1个回答
0
投票

问题出在

customization.xjb
的错误路径上。当
jaxws-maven-plugin:wsimport
运行时,它会抛出一个异常,Maven 捕获它并将其包装到自己的异常中。

© www.soinside.com 2019 - 2024. All rights reserved.