This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 5823
    
    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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to copy generated wsdl file to WAR file?