Author: cschneider
Date: Thu Sep 3 14:52:43 2009
New Revision: 810982
URL: http://svn.apache.org/viewvc?rev=810982&view=rev
Log:
CXF-2276 Support attaching generated WSDLs to the Maven build. Implementation
finished. We need a test for this feature
Modified:
cxf/trunk/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java
Modified:
cxf/trunk/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java?rev=810982&r1=810981&r2=810982&view=diff
==============================================================================
---
cxf/trunk/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java
(original)
+++
cxf/trunk/maven-plugins/java2ws-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java
Thu Sep 3 14:52:43 2009
@@ -30,6 +30,7 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectHelper;
/**
* @goal java2ws
@@ -91,6 +92,14 @@
private MavenProject project;
/**
+ * Maven ProjectHelper.
+ *
+ * @component
+ * @readonly
+ */
+ private MavenProjectHelper projectHelper;
+
+ /**
* @parameter
*/
private String argline;
@@ -121,6 +130,16 @@
*/
private Boolean genWrapperbean;
+ /**
+ * Attach the generated wsdl file to the list of files to be deployed
+ * on install. This means the wsdl file will be copied to the repository
+ * with groupId, artifactId and version of the project and type "wsdl".
+ *
+ * With this option you can use the maven repository as a Service
Repository.
+ *
+ * @parameter default-value="false"
+ */
+ private Boolean attachWsdl;
public void execute() throws MojoExecutionException {
StringBuffer buf = new StringBuffer();
@@ -248,6 +267,13 @@
getLog().debug(e);
throw new MojoExecutionException(e.getMessage(), e);
}
+
+ // Attach the generated wsdl file to the artifacts that get deployed
+ // with the enclosing project
+ if (attachWsdl && outputFile != null) {
+ File wsdlFile = new File(outputFile);
+ projectHelper.attachArtifact(project, "wsdl", wsdlFile);
+ }
}
}
\ No newline at end of file