File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes How to copy generated wsdl file to WAR file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to copy generated wsdl file to WAR file?" Watch "How to copy generated wsdl file to WAR file?" New topic
Author

How to copy generated wsdl file to WAR file?

sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
Hi,

I have a wsdl file automatically generated when executing maven build.
The location of the wsdl file is in the following path:

target/generated/wsdl/OrderProcess.wsdl

How to add a "copy" lines in my pom.xml file so that the generated wsdl file get packaged into a war file?

I tried to following code in pom.xml, no luck:



Very appreciate for any suggestion.
Thanks
Sam
sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
Hello,

With the following pom.xml file:



Build project generated the following output:



I don't understand why the OrderProcess.wsdl file is copied to 0.0.1-SNAPSHOT\order-ws-0.0.1-SNAPSHOT.wsdl.
And secondly it is not packaged into the war file.

Can anyone help please?

Thanks
Sam
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

Which plugin is it that you are using to generate the wsdl? (Oh, I see which plugin it is: cxf-java2ws-plugin) In the future, please post the full plugin description, not just the executions section.

Based on the behavior exhibited, I suspect that cxf-java2ws-plugin registered the wsdl as an artifact of the build and thus the install plugin copied it to the local repository. (Personally, I think that cxf-java2ws-plugin did this incorrectly and that it should have registered the wsdl with a classifier, but that is beside the point.)

You might have to look at the documentation for the plugin to see if you can specify a target directory and change that to place the wsdl into target/classes (in which case it will end up in WEB-INF/classes in the WAR) ) or target/${project.artifactId} to place it any where else in the WAR.
http://cxf.apache.org/docs/maven-java2ws-plugin.html
Looks luke you need to set <outputFile>.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to copy generated wsdl file to WAR file?
 
Similar Threads
How to change jetty binding port number in maven.
Filtering problem using maven-read-properties plugin in pom.xml file
Tomcat and Axis2
Strange problem - works on maven glassfish but not on Tomcat
How to change jetty binding port number in maven.