Does it have a meaningful tutorial that shows how to create WSDL from java code using maven and cxf goal java2ws?
I want to run mvn install
on a project containing the annotated @WebService
class and create a WSDL somewhere inside the target folder so that another developer can use it to create subscriber classes.
I also want the Webservice to be included in the bank, which I can deploy inside the WebService container so that the service is available to the subscriber.
So far my pom looks like this:
<properties> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <cxf.version>2.2.3</cxf.version> </properties> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>${cxf.version}</version> <dependencies> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>2.0.9</version> </dependency> </dependencies> <executions> <execution> <id>generate-wsdl</id> <phase>process-classes</phase> <goals> <goal>java2ws</goal> </goals> <configuration> <outputFile>${project.build.outputDirectory}/testService.wsdl</outputFile> <className>complete.path.to.ClassName</className> <verbose>true</verbose> </configuration> </execution> </executions> </plugin> </plugins> </pluginManagement> </build> <pluginRepositories> <pluginRepository> <id>apache-snapshots</id> <name>Apache SNAPSHOT Repository</name> <url>http://repository.apache.org/snapshots/</url> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> <repositories> <repository> <id>apache-snapshots</id> <name>Apache SNAPSHOT Repository</name> <url>http://repository.apache.org/snapshots/</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>http://download.java.net/maven/2/</url> <layout>default</layout> </repository> </repositories> <dependencies> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>${cxf.version}</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http</artifactId> <version>${cxf.version}</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http-jetty</artifactId> <version>${cxf.version}</version> </dependency> </dependencies>
But when I run maven install .. no wsdl ..
Oh, well, additional information: We are developing modularly. The module that the WebService provides will contain other classes that handle internal method calls from the frontend module and will be created as a bank, not a war.
Hope someone finds what I am missing, or can point me to a good tutorial.
EDIT: The target is called directly using mvn org.apache.cxf:cxf-java2ws-plugin:java2ws
, but I get a LifecycleExecutionException
:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.cxf:cxf-java2ws-plugin:2.2.3:java2ws (default-cli) on project dw-person: The parameters 'className' for goal o rg.apache.cxf:cxf-java2ws-plugin:2.2.3:java2ws are missing or invalid at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:221) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: org.apache.maven.plugin.PluginParameterException: The parameters 'className' for goal org.apache.cxf:cxf-java2ws-plugin:2.2.3:java2ws are missing or invalid at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:576) at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:529) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 more
The className parameter exists, as seen above, and the path is correct ... Any ideas?
source share