Have you tried putting all <wsdlOption/> elements you have below under one single <wsdlOptions/> element in one plugin definition, that would simplify your pom and also probably reduce the Maven overhead (if not the actual processing time, which would still be cumulative.)

To eliminate your maven-jar-plugin definitions, the Maven assembly plugin (http://maven.apache.org/plugins/maven-assembly-plugin/) allows you, from a single configuration file to chop up the generated classes & assorted files into as many JARs that you like (the default Maven JAR plugin will still create a JAR containing everything, but you can just ignore that file.) Such chopping will be easier though if your different WSDLs have different namespaces (as they should anyway), so the generated classes will be in different folders. My WSDL-first tutorial has an example of usage of the Assembly plugin (look in the service submodule pom: http://www.jroller.com/gmazza/entry/web_service_tutorial#WFstep3-service), albeit it is just for one subsetted JAR.

HTH,
Glen


On 06/08/2012 12:43 AM, santoshkumar wrote:
Looking for help as how to increase performance of wsdl2Java code gen with
CXF for multiple wsdls. The requirement is each wsdl needs to generate code
and jar it to specific jar. ( Have to use xmlbeans as databinding).
For example : airport.wsdl ->  airport.jar
luggage.wsdl ->luggage.jar
The pom file has execution for each wsdl and individually jar the generated
classes.
a. How to jar the compiled classes with cxf maven itself instead of invoking
maven jar plugin?
b. Is there better way to avoid individual executions for each wsdl?
(Need to use multiple executions to generated the compiled classes in diff
directory to enable compiled code jar to mapped jar.)
c. Can multiple wsdlOption can be used for multiple wsdls compiling code in
diff dir?. How it can be done?

Following is my pom: ( want to optimize the file to get better performance
for code gen)
<dependencies>
           <dependency>
             <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-databinding-xmlbeans</artifactId>
                <version>2.5.0</version>
           </dependency>
</dependencies>

   <build>
      <plugins>
        <plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-codegen-plugin</artifactId>
             <version>2.6.0</version>
             <executions>
        <execution>
        <id>gen-srcexec1</id>
        <phase>generate-sources</phase>
        <configuration>
                <wsdlOptions>
                <wsdlOption>
                <wsdl>/home/prj/wsdls/airport.wsdl</wsdl>
                        <extraargs>
                        <extraarg>-db</extraarg>
                        <extraarg>xmlbeans</extraarg>
                        <extraarg>-compile</extraarg>
                        <extraarg>-classdir</extraarg>

<extraarg>/home/prj/target/airport/classes</extraarg>                           
            
                              </extraargs>
                        </wsdlOption>                                     
                </wsdlOptions>
        </configuration>
        <goals>
        <goal>wsdl2java</goal>
        </goals>
        </execution>

            <execution>
        <id>gen-srcexec2</id>
        <phase>generate-sources</phase>
        <configuration>
                <wsdlOptions>
                <wsdlOption>
                <wsdl>/home/santkumar/prj/wsdls/luggage.wsdl</wsdl>
                        <extraargs>
                        <extraarg>-db</extraarg>
                        <extraarg>xmlbeans</extraarg>
                        <extraarg>-compile</extraarg>
                        <extraarg>-classdir</extraarg>

<extraarg>/home/prj/target/luggage/classes</extraarg>                           
    
                              </extraargs>
                </wsdlOption>                                     
                </wsdlOptions>
        </configuration>
                 <goals>
        <goal>wsdl2java</goal>
        </goals>
        </execution>              
          </executions>
          </plugin>
         <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-jar-plugin</artifactId>
             <version>2.3.1</version>
        <executions>
                 <execution>
                   <id>gen-jar1</id>
                   <configuration>

<classesDirectory>/home/prj/target/airport/classes</classesDirectory>

<outputDirectory>/home/prj/target/airport/lib</outputDirectory>
        <finalName>airport</finalName>
                  </configuration>
              <goals>
                <goal>jar</goal>
             </goals>
            </execution>

            <execution>
               <id>gen-jar2</id>
                <configuration>

<classesDirectory>/home/prj/target/luggage/classes</classesDirectory>
                        
<outputDirectory>/home/prj/target/luggage/lib</outputDirectory>
                <finalName>luggage</finalName>
                </configuration>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>          
        </executions>
       </plugin>
      </plugins>
     </build>

Is there better way to optimize the pom to get better performance from
wsdl2Java code gen.

--
View this message in context: 
http://cxf.547215.n5.nabble.com/CXF-with-Maven-How-to-increase-performance-of-wsdl2Java-code-gen-for-multiple-wsdls-tp5709382.html
Sent from the cxf-user mailing list archive at Nabble.com.


--
Glen Mazza
Talend Community Coders
coders.talend.com
blog: www.jroller.com/gmazza

Reply via email to