Issue Details (XML | Word | Printable)

Key: SMXCOMP-450
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Freeman Fang
Reporter: Martin Murphy
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ServiceMix Components

CXF Binding Component ships with the generated code from the hello_world.wsdl

Created: 05/Nov/08 08:14 AM   Updated: 15/Feb/09 03:06 AM
Return to search
Component/s: servicemix-cxf-bc
Affects Version/s: servicemix-cxf-bc-2008.01
Fix Version/s: 3.2.4, servicemix-cxf-bc-2009.01

Time Tracking:
Not Specified

File Attachments:
  Size
Text File build.err.log 2008-11-05 09:00 AM Martin Murphy 40 kB
Text File Licensed for inclusion in ASF works SM-1675-2nd.patch.txt 2008-11-05 09:20 AM Martin Murphy 0.7 kB
Text File Licensed for inclusion in ASF works SM-1675.patch.txt 2008-11-05 08:16 AM Martin Murphy 1 kB

Patch Info: Patch Available


 Description  « Hide
During the generate-sources phase the WSDL is compiled for the tests, the problem is that this generated code and classes are never removed before the packaging. If you check the CXF BC you will see these are all included in the JAR.

Unfortunately there is no obvious Maven phase that can be used to clean this up in Maven 2.0.9, although there is an improvement which will allow a prepare-package phase to run, we could remove the generated code here. We could clean this up when Maven 2.0.11 is released. We would need to add something like this:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <configuration>
              <tasks>
                <echo message="Cleaning up generated code before package"/>
                <delete dir="${basedir}/target/generated"/>
                <delete dir="${basedir}/target/classes/org/apache/hello_world_soap_http"/>
                <delete dir="${basedir}/target/classes/org/apache/hello_world_soap_http_provider"/>
                <delete dir="${basedir}/target/classes/org/apache/servicemix/samples"/>
                <delete dir="${basedir}/target/classes/uri"/>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>


 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Martin Murphy added a comment - 05/Nov/08 08:16 AM
Here's a patch that won't affect earlier versions of Maven and should clean up the Binding Component once Maven 2.0.11 is released

Daniel Kulp added a comment - 05/Nov/08 08:23 AM

I think the "correct" fix is to move the codegeneration into the generate-test-sources phase and make it generate into target/generated/test/java instead. Thus, it's all treated as test artifacts, not source.


Martin Murphy added a comment - 05/Nov/08 09:00 AM
That was the first thing I tried, before going with the prepare-package phase
Problem is that the generated code isn't compiled then since the generate-test-sources is after the compile phase, so when the tests go to run, the generated code is there, but hasn't been compiled. Maybe there is something I could add to the test mojo, but I can't see anything of use.

Martin Murphy added a comment - 05/Nov/08 09:20 AM
Here is an improved version of the patch that will work with Maven today. This is based on Dan's suggestions. Thanks Dan!

Freeman Fang added a comment - 11/Nov/08 08:17 PM
apply patch on befalf of Martin Murphy with thanks
http://svn.apache.org/viewvc?rev=713258&view=rev for servicemix-cxf-bc component project
http://svn.apache.org/viewvc?rev=713261&view=rev for 3.2 branch