【问题标题】:successfully building but the wsdl file not found?成功构建但未找到 wsdl 文件?
【发布时间】:2013-08-02 22:05:44
【问题描述】:

我尝试使用 jaxws maven 插件生成 wsdl 文件 finaly:“成功构建”但我的 wsdl 文件没有生成,它通常在文件夹 \target\surefire-reports 中 但是建完之后就没有了

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building BSCSwebservices Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.sun.xml.stream.buffer:streambuffer:jar:0.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
 [WARNING] The POM for org.jvnet.staxex:stax-ex:jar:1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ BSCSwebservices ---
[debug] execute contextualize
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 6 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ BSCSwebservices ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ BSCSwebservices ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\sayed\workspace\BSCSwebservices\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ BSCSwebservices ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ BSCSwebservices ---
[INFO] Surefire report directory: C:\Users\sayed\workspace\BSCSwebservices\target\surefire-reports

T E S T S

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ BSCSwebservices ---
[INFO] Packaging webapp
[INFO] Assembling webapp [BSCSwebservices] in [C:\Users\sayed\workspace\BSCSwebservices\target\BSCSwebservices]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\sayed\workspace\BSCSwebservices\src\main\webapp]
[INFO] Webapp assembled in [1042 msecs]
[INFO] Building war: C:\Users\sayed\workspace\BSCSwebservices\target\BSCSwebservices.war
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored 
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')
[INFO] 
[INFO] --- jaxws-maven-plugin:1.11:wsgen (default) @ BSCSwebservices ---

warning: The apt tool and its associated API are planned to be
removed in the next major JDK release.  These features have been
superseded by javac and the standardized annotation processing API,
javax.annotation.processing and javax.lang.model.  Users are
recommended to migrate to the annotation processing features of
javac; see the javac man page for more information.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:30.437s
[INFO] Finished at: Fri Aug 02 23:00:03 WAT 2013
[INFO] Final Memory: 16M/40M
[INFO] ------------------------------------------------------------------------

这是 pom.xml 的一部分

<plugins>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <version>1.11</version>
        <executions>
                <execution>
                <configuration>
                <sei>com.ws.BillingAccountRead</sei>
                <genwsdl>true</genwsdl>  
                 <keep>true</keep>

        </configuration>
                <phase>package</phase>      
                        <goals>
                        <goal>wsgen</goal>
                        </goals>


                </execution>

        </executions>


    </plugin>
    </plugins>
    </build>
  </project>

当我使用 mvn clean package -X 时

<configuration>
 <destDir default-value="${project.build.outputDirectory}"/>
 <extension default-value="false"/>
 <genWsdl default-value="false"/>
 <keep default-value="false">true</keep>
 <pluginArtifactMap>${plugin.artifactMap}</pluginArtifactMap>
 <pluginArtifacts>${plugin.artifacts}</pluginArtifacts>
 <project>${project}</project>
 <resourceDestDir default-value="${project.build.directory}/jaxws/wsgen/wsdl"/>

 <sei>com.ws.BillingAccountRead</sei>
 <verbose default-value="false">true</verbose>
</configuration>

【问题讨论】:

  • 也许它是在其他地方生成的?你搜索过吗?也许它只是临时生成的,后来被删除了?
  • 不,它没有生成,这个问题是否与生命周期有关,我在哪里可以找到它。谢谢

标签: java maven jax-ws


【解决方案1】:

我认为您可能希望在“生成源”阶段或“生成资源”而不是“包”阶段构建 wsdl

【讨论】:

  • 它是相同的无 wsdl 文件,但在 eclipse 的标记中,当我使用 generate-sources 时出现此消息;描述资源路径位置类型插件执行未包含在生命周期配置中:org.codehaus.mojo:jaxws -maven-plugin:1.11:wsgen pom.xml line 177 Maven项目构建生命周期映射问题
【解决方案2】:

它应该在${resourceDestDir} 中生成wsdl 如下配置verbose = true,并执行带有-X标志的mvn命令,然后仔细查看maven日志。

<executions>
                <execution>
                <configuration>
                <sei>com.ws.BillingAccountRead</sei>
                <genwsdl>true</genwsdl>  
                 <keep>true</keep>
                <verbose>true</verbose>
        </configuration>
                <phase>package</phase>      
                        <goals>
                        <goal>wsgen</goal>
                        </goals>


                </execution>

        </executions>

【讨论】:

  • 调试的好主意。 -X 会给出很多输出,但你可以更好地弄清楚发生了什么。
  • 你能分享-X标志的输出吗?
  • 我使用 mvn clean package 时的唯一警告 - X:[INFO] Building BSCSwebservices Maven Webapp 0.0.1-SNAPSHOT [INFO] --------------- -------------------------------------------------- ------- [警告] com.sun.xml.stream.buffer:streambuffer:jar:0.4 的 POM 无效传递依赖项(如果有)将不可用,启用调试日志以获取更多详细信息 [警告] org.jvnet.staxex:stax-ex:jar:1.0 的 POM 无效,传递依赖项(如果有)将不可用,请启用调试日志以获取更多详细信息
【解决方案3】:

尝试使用 -X 或 -e 构建以从日志中获取更多信息

【讨论】:

  • 构建不可用的生命周期
猜你喜欢
  • 1970-01-01
  • 2012-01-12
  • 2011-07-31
  • 1970-01-01
  • 1970-01-01
  • 2018-12-05
  • 2020-05-13
  • 2020-06-05
  • 2016-04-28
相关资源
最近更新 更多