jaxws-maven-plugin LifecycleExecutionException

时间:2011-02-28 17:01:08

标签: wsdl maven jax-ws

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

我有下一个stacktrace:

[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

1 个答案:

答案 0 :(得分:0)

问题出在customization.xjb的错误路径上。当wsimport运行时,它会抛出异常并且maven捕获它并将其包装到它自己的异常中。