Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350081 - [mojo] org.apache.cxf:cxf-codegen-plugin support
Summary: [mojo] org.apache.cxf:cxf-codegen-plugin support
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-22 13:16 EDT by Mike Pettypiece CLA
Modified: 2021-04-19 13:24 EDT (History)
10 users (show)

See Also:


Attachments
Example project (2.73 KB, application/x-zip-compressed)
2011-06-22 13:19 EDT, Mike Pettypiece CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Pettypiece CLA 2011-06-22 13:16:46 EDT
Build Identifier: 20110615-0604

Add the cxf-codegen-plugin to the lifecyclemappings, as defined by
http://wiki.eclipse.org/M2E_plugin_execution_not_covered

Reproducible: Always

Steps to Reproduce:
Import attached project.  The plugin should generated a new source folder named target/generated-sources/cxf and be added to the Eclipse classpath (as it did in m2e 0.12)
Comment 1 Mike Pettypiece CLA 2011-06-22 13:19:08 EDT
Created attachment 198422 [details]
Example project
Comment 2 Axel Wathne CLA 2011-06-23 08:03:01 EDT
I am having the same problem. Manual workaround so far:

- Right-click project (or project parent) and choose Run as -> Maven generate-sources
- Right-click target/generated-sources/cxf and choose Build Path -> Use as source folder, for every cxf project
- Right-click project(s) and choose Maven -> Disable Maven Nature (to avoid warnings that projects and poms are not synchronized)
Comment 3 Igor Fedorenko CLA 2011-06-29 02:13:12 EDT
m2e core development team is looking for help implementing support for various "not covered" maven plugins. If you are interested, wiki [1] provides pointers where to start and we'll be happy to answer questions on m2e-dev mailing list. To avoid duplicate effort, please assign this bugzilla item to yourself if you already work on corresponding m2e extension.

[1] m2e extension development is documented in http://wiki.eclipse.org/M2E_Extension_Development
Comment 4 Mike Pettypiece CLA 2011-06-29 23:23:09 EDT
I'm going to take a stab at this - the code will be in https://github.com/mtpettyp/m2eclipse-extras
Comment 5 Falko Modler CLA 2011-07-27 08:52:39 EDT
(In reply to comment #4)
> I'm going to take a stab at this - the code will be in
> https://github.com/mtpettyp/m2eclipse-extras

Any news on that?
Is there already some p2-site providing that new connector?
Comment 6 Stevo Slavic CLA 2011-08-26 04:37:34 EDT
I did some work on cxf-codegen connector(see here https://github.com/sslavic/m2e-cxf-codegen-connector ). Jaxb2 connector found here https://github.com/bitstrings/m2e-jaxb2-connector has been used as basis for project structure and ideas. Now I'm stuck, have to implement tests but would like to try connector also on local eclipse installation first. Not sure how to do the publishing part as well. So if anyone has some experience with this to continue the work, EPL 1.0 is the license.
Comment 7 Jason van Zyl CLA 2011-12-28 18:17:24 EST
I have started integrating this on a branch here:

https://github.com/sonatype/m2eclipse-extras/tree/cxf

My friend Dan Diephouse who is a CXF committer was having problems so I took a look at the contributed code and started cleaning it up. I'll test it with Dan and if he thinks CXF behavior is correct inside M2E we'll publish it to the marketplace.
Comment 8 Stian Soiland-Reyes CLA 2012-04-16 08:58:55 EDT
Jason, this sounds very promising. Any news on this integration..?


As reference for new readers - here is my workaround using the buildhelper connector, modified from http://stackoverflow.com/questions/6691723/m2e-generated-code-with-exec-maven-plugin

  <properties>
    <cxf.version>2.5.2</cxf.version>
  </properties>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-codegen-plugin</artifactId>
        <version>${cxf.version}</version>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
              <!-- default: <sourceRoot>${project.build.directory}/generated-sources/cxf/</sourceRoot> -->
              <wsdlOptions>
                <wsdlOption>
                  <wsdl>http://www.ivoa.net/wsdl/RegistrySearch/v1.0</wsdl>
                  <extraargs>
                    <extraarg>-client</extraarg>
                    <extraarg>-catalog</extraarg>
                    <extraarg>${basedir}/src/main/resources/META-INF/jax-ws-catalog.xml</extraarg>
                  </extraargs>
                </wsdlOption>
              </wsdlOptions>
            </configuration>
            <goals>
              <goal>wsdl2java</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <!-- So that Eclipse m2e (with the buildhelper m2e connector) can find 
          the generated sources -->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/cxf/</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <!-- So that cxf codegen is done by m2e -->
        <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>[${cxf.version},)</versionRange>
                    <goals>
                      <goal>wsdl2java</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute> <!-- but not on every save! -->                      
                      <runOnIncremental>false</runOnIncremental>
                    </execute>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
Comment 9 Stevo Slavic CLA 2012-04-18 19:44:06 EDT
I've created request on CXF JIRA (see [1]) to add lifecycle mappings in the cxf-codegen-plugin itself. This would require m2e 1.1 but I believe it is better approach than having connectors built outside of cxf project, assuming that lifecycle mapping API would change less frequently than cxf-codegen-plugin and cxf.

[1]: https://issues.apache.org/jira/browse/CXF-4152
Comment 10 Holger Peinsipp CLA 2012-07-02 15:57:05 EDT
Just received a notification: The CXF JIRA issue has now been marked as resoved - fixed.
https://issues.apache.org/jira/browse/CXF-4152
Comment 11 Igor Fedorenko CLA 2013-09-28 23:40:09 EDT
closing as per last comment
Comment 12 Denis Roy CLA 2021-04-19 13:24:18 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/