6

I have written a WSDL and I want to generate java classes.

I use the cxf-codegen-plugin for maven2, but I get the following validation error in Eclipse:

Plugin execution not covered by lifecycle configuration: org.apache.cxf:cxf-codegen-plugin:2.2.7:wsdl2java (execution: generate-sources, phase: generate-sources).

Can anybody help me to resolve this? Or propose another solution?

Rob Kielty
  • 7,958
  • 8
  • 39
  • 51
Constantine Gladky
  • 1,245
  • 6
  • 27
  • 45
  • This link should be useful : http://stackoverflow.com/questions/3009916/hyperjaxb-and-apache-cxf – davecon Jan 05 '12 at 15:52

3 Answers3

5

You can add this snippet to your pom.xml (from the link published by @Jörn Horstmann):

<pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings 
                    only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.cxf</groupId>
                                        <artifactId>cxf-codegen-plugin</artifactId>
                                        <versionRange>[2.3.3,)</versionRange>
                                        <goals>
                                            <goal>wsdl2java</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

The more important lines are:

<groupId>org.apache.cxf</groupId>
                                        <artifactId>cxf-codegen-plugin</artifactId>
                                        <versionRange>[2.3.3,)</versionRange>
                                        <goals>
                                            <goal>wsdl2java</goal>
                                        </goals>

So, you have to ensure what version of CXF are you using... Hope this can help...

Jesfre
  • 702
  • 8
  • 13
5

The error message sounds like it is coming from the maven eclipse integration (m2e). If the build works from the command line but not from within eclipse then maybe this article on the eclipse wiki can help you to configure eclipse.

This answer shows the solution for a similar problem with another maven plugin.

Community
  • 1
  • 1
Jörn Horstmann
  • 33,639
  • 11
  • 75
  • 118
  • 1
    http://wiki.eclipse.org/M2E_plugin_execution_not_covered#execute_plugin_goal adding this section into my pom.xml sovled my problem. Thanks a lot. – Constantine Gladky Jan 06 '12 at 07:39
0

Change the plugin version to this especific. After, Run Maven Update Project, and finally Run Maven generate-sources

<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.7.10</version>

Best regards,

mvelosus
  • 15
  • 4