I use the Maven cxf-java2ws-plugin:java2ws to generate WSDLs from WebService Java classes.
For each Service, I create an execution of the plugin, as suggest in this link http://mail-archives.apache.org/mod_mbox/cxf-users/201003.mbox/%3C201003132152.email@example.com%3E . I have not found any other option to generate multiple services in a single project.
By default in the latest version of cxf-java2ws-plugin the configuration parameter "attachWsdl" is true.
That means that the plugin generates a WSDL for each execution. Unfortunately, the plugin during the maven install phase tries to attache each generated WSDL to the local repository in the maven repository with the name:
The naming of the file is the reason that maven does not copy all the WSDLs . Only the one of the first execution of the plugin get's copied. The plugin checks if the file exists already and it skips the others (which are named with the same name).
Equally important, Maven version 3.3.3 does not allow to release a Maven project. (Maven 3.0.5 had a different process)
The maven deploy plugin during the release uploads to the enterprise repository the first generated WSDL successfully. But then it tries to upload the WSDL from second execution, but that already exists in the Maven Enterprise Repository (the WSDLs have the same name). Thus, the project cannot upload the WSDLs and it cannot also get released.
We may set the attachWsdl option to false, but this is not a solution, as for some the goal is to deploy the WSDL files.
I attach a zip with a maven project that demonstrates the issue.
You see that the plugin copies in the local repository only the last WSDL file, instead of generating once for each execution.
Deploying a release version to a Maven Enterprise Repository throws an HTML 400 error, as normally a release repository does not allow the redeployment of file.
In the end of the day, the plugin does not allow to copy to a repository each WSDL. This is against to what it promotes and what its goal was.
A simple change is the solution. Add in the name of each generated WSDL the name of the Service that it represents too.