cxf-codegen-plugin不生成源 [英] cxf-codegen-plugin doesn't generate sources

查看:129
本文介绍了cxf-codegen-plugin不生成源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取 cxf-codegen-plugin 来从wsdl文件生成源.在调用wsdl2java手册时,会生成所需的类,但是在使用 mvn generate-sources 时,什么也没有发生,并且我收到消息项目不需要目标".直接调用插件没有帮助.

I'm trying to get the cxf-codegen-plugin to generate sources from my wsdl file. When calling wsdl2java manual the desired classes are generated but when using mvn generate-sources nothing happens and I get the message "No goals needed for project". Calling the plugin directly doesn't helps.

我的诗歌摘录如下:

<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>2.5.2</version>
    <executions>
        <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
                <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
                <wsdlOptions>
                    <wsdlOption>
                        <wsdl>${basedir}/src/main/MyServiceInterface.wsdl</wsdl>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>

推荐答案

这非常类似于我(成功)在我的一个项目中配置该插件的方式.我希望它能奏效. (我相信您可以省略<sourceRoot>;默认设置是您所说的.)

That looks very much like the way I (successfully) configure that plugin in one of my projects; I would expect that to work. (I believe you can omit the <sourceRoot>; the default setting for that is the one you've stated.)

我唯一能想到的是,如果您将该插件配置放置在非活动的Maven配置文件中,或者(更可能是)放置在<pluginManagement>部分而不是直接的<plugins>部分中; pluginManagement部分覆盖了插件配置的各个方面,但实际上并未启用它们. (但是,它确实会影响显式用法;我知道您不想这样做.)

The only thing I can think of would be if you had put that plugin configuration in either a non-active Maven profile or (more likely) in the <pluginManagement> section instead of the straight <plugins> section; the pluginManagement section overrides aspects of the configuration of plugins, but doesn't actually enable them for use. (It does however affect explicit usage; I know you don't want to do that.)

这篇关于cxf-codegen-plugin不生成源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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