cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/5] cxf git commit: Update plugins to use annotations instead of the javadoc things
Date Mon, 02 Feb 2015 18:59:00 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 27e877346 -> 96ed80508


Update plugins to use annotations instead of the javadoc things


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/96ed8050
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/96ed8050
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/96ed8050

Branch: refs/heads/master
Commit: 96ed80508cf15f7dc8c2d5a73225a36dbc096ee2
Parents: bfbc0a2
Author: Daniel Kulp <dkulp@apache.org>
Authored: Mon Feb 2 13:58:09 2015 -0500
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Mon Feb 2 13:58:43 2015 -0500

----------------------------------------------------------------------
 maven-plugins/codegen-plugin/pom.xml            | 42 ++-------
 .../cxf/maven_plugin/AbstractCodegenMoho.java   | 85 +++++++-----------
 .../maven_plugin/wsdl2java/WSDL2JavaMojo.java   | 30 +++----
 .../wsdl2js/WSDL2JavaScriptMojo.java            | 28 +++---
 maven-plugins/corba/pom.xml                     | 37 --------
 maven-plugins/java2wadl-plugin/pom.xml          | 52 +++--------
 .../javatowadl/ParseJavaDocMojo.java            | 91 ++++++++------------
 maven-plugins/java2ws-plugin/pom.xml            | 37 --------
 maven-plugins/pom.xml                           | 20 -----
 maven-plugins/wadl2java-plugin/pom.xml          | 42 ++-------
 .../wadlto/AbstractCodeGeneratorMojo.java       | 81 +++++------------
 .../cxf/maven_plugin/wadlto/WADL2JavaMojo.java  | 29 +++----
 maven-plugins/wsdl-validator-plugin/pom.xml     | 37 --------
 parent/pom.xml                                  | 12 +++
 pom.xml                                         | 31 +++++++
 15 files changed, 194 insertions(+), 460 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/codegen-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/pom.xml b/maven-plugins/codegen-plugin/pom.xml
index 521d097..0259a06 100644
--- a/maven-plugins/codegen-plugin/pom.xml
+++ b/maven-plugins/codegen-plugin/pom.xml
@@ -56,6 +56,11 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.maven.plugin-tools</groupId>
+            <artifactId>maven-plugin-annotations</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-utils</artifactId>
             <version>2.0.5</version>
@@ -148,41 +153,4 @@
             </dependencies>
         </profile>
     </profiles>
-    <build>
-    	<pluginManagement>
-    		<plugins>
-    			<!--This plugin's configuration is used to store Eclipse m2e settings only. It
has no influence on the Maven build itself.-->
-    			<plugin>
-    				<groupId>org.eclipse.m2e</groupId>
-    				<artifactId>lifecycle-mapping</artifactId>
-    				<version>1.0.0</version>
-    				<configuration>
-    					<lifecycleMappingMetadata>
-    						<pluginExecutions>
-    							<pluginExecution>
-    								<pluginExecutionFilter>
-    									<groupId>
-    										org.apache.maven.plugins
-    									</groupId>
-    									<artifactId>
-    										maven-plugin-plugin
-    									</artifactId>
-    									<versionRange>
-    										[2.9,)
-    									</versionRange>
-    									<goals>
-    										<goal>descriptor</goal>
-    									</goals>
-    								</pluginExecutionFilter>
-    								<action>
-    									<ignore></ignore>
-    								</action>
-    							</pluginExecution>
-    						</pluginExecutions>
-    					</lifecycleMappingMetadata>
-    				</configuration>
-    			</plugin>
-    		</plugins>
-    	</pluginManagement>
-    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
index 91206e9..addd797 100644
--- a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
+++ b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
@@ -50,6 +50,8 @@ import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Resource;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.repository.RepositorySystem;
 import org.apache.maven.settings.Proxy;
@@ -92,125 +94,98 @@ public abstract class AbstractCodegenMoho extends AbstractMojo {
     private static final String HTTP_PROXY_PASSWORD = "http.proxyPassword";
     
 
-    /**
-     * @parameter expression="${project.build.outputDirectory}"
-     * @required
-     */
+    @Parameter(property = "project.build.outputDirectory", required = true)
     protected String classesDirectory;
    
     /**
      * By default all maven dependencies of type "wsdl" are added to the effective wsdlOptions.
Setting this
      * parameter to true disables this functionality
-     * 
-     * @parameter expression="${cxf.disableDependencyScan}" default-value="false"
      */
+    @Parameter(property = "cxf.disableDependencyScan", defaultValue = "false")
     protected boolean disableDependencyScan;
+    
     /**
      * Disables the scanning of the wsdlRoot/testWsdlRoot directories.
      * By default, we scan for *.wsdl (see include/exclude params as well) in the wsdlRoot
      * directories and run the tool on all the wsdls we find. This disables that scan
      * and requires an explicit wsdlOption to be set for each wsdl that needs to be processed.
-     * @parameter expression="${cxf.disableDirectoryScan}" default-value="false"
      */
+    @Parameter(property = "cxf.disableDirectoryScan", defaultValue = "false")
     protected boolean disableDirectoryScan;
+    
     /**
      * Allows running the JavaToWs in a separate process. Valid values are "false", "always",
and "once" The
      * value of "true" is equal to "once"
-     * 
-     * @parameter default-value="false"
-     * @since 2.4
      */
+    @Parameter(defaultValue = "false")
     protected String fork;
+    
     /**
      * A list of wsdl files to include. Can contain ant-style wildcards and double wildcards.
Defaults to
      * *.wsdl
-     * 
-     * @parameter
      */
+    @Parameter
     protected String includes[];
     /**
      * Directory in which the "DONE" markers are saved that
-     * 
-     * @parameter expression="${cxf.markerDirectory}"
-     *            default-value="${project.build.directory}/cxf-codegen-plugin-markers"
      */
+    @Parameter(property = "cxf.markerDirectory", defaultValue = "${project.build.directory}/cxf-codegen-plugin-markers")
     protected File markerDirectory;
+    
     /**
-     * The plugin dependencies, needed for the fork mode.
-     * 
-     * @parameter expression="${plugin.artifacts}"
-     * @required
-     * @readonly
+     * The plugin dependencies, needed for the fork mode
      */
+    @Parameter(required = true, readonly = true, property = "plugin.artifacts")
     protected List<Artifact> pluginArtifacts;
-    /**
-     * @parameter expression="${project}"
-     * @required
-     */
+    
+    @Parameter(required = true, property = "project")
     protected MavenProject project;
+    
     /**
      * Use the compile classpath rather than the test classpath for execution useful if the
test dependencies
      * clash with those of wsdl2java
-     * 
-     * @parameter expression="${cxf.useCompileClasspath}" default-value="false"
      */
+    @Parameter(property = "cxf.useCompileClasspath", defaultValue = "false")
     protected boolean useCompileClasspath;
+    
     /**
      * A list of wsdl files to exclude. Can contain ant-style wildcards and double wildcards.
-     * 
-     * @parameter
      */
+    @Parameter
     protected String excludes[];
-    /**
-     * @parameter expression="${cxf.testWsdlRoot}" default-value="${basedir}/src/test/resources/wsdl"
-     */
+    
+    @Parameter(property = "cxf.testWsdlRoot", defaultValue = "${basedir}/src/test/resources/wsdl")
     protected File testWsdlRoot;
    
-    /**
-     * @parameter expression="${cxf.wsdlRoot}" default-value="${basedir}/src/main/resources/wsdl"
-     */
+    @Parameter(property = "cxf.wsdlRoot", defaultValue = "${basedir}/src/main/resources/wsdl")
     protected File wsdlRoot;
     
-    /** @component */
+    @Component
     protected BuildContext buildContext;
     
     
     /**
      * Sets the JVM arguments (i.e. <code>-Xms128m -Xmx128m</code>) if fork is
set to <code>true</code>.
-     * 
-     * @parameter expression="${cxf.codegen.jvmArgs}"
-     * @since 2.4
      */
+    @Parameter(property = "cxf.codegen.jvmArgs")
     private String additionalJvmArgs;
 
     /**
      * Sets the Java executable to use when fork parameter is <code>true</code>.
-     * 
-     * @parameter default-value="${java.home}/bin/java"
-     * @since 2.4
      */
+    @Parameter(defaultValue = "${java.home}/bin/java")
     private String javaExecutable;
 
     /**
      * The Maven session.
-     * 
-     * @parameter expression="${session}"
-     * @readonly
-     * @required
      */
+    @Parameter(readonly = true, required = true, property = "session")
     private MavenSession mavenSession;
-    /**
-     * @component
-     * @readonly
-     * @required
-     */
+    
+    @Component
     private ProjectDependenciesResolver projectDependencyResolver;
     
-    /**
-     * @component
-     * @readonly
-     * @required
-     */
+    @Component
     private RepositorySystem repositorySystem;
     
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
index 92e6955..a99b988 100644
--- a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
+++ b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
@@ -47,15 +47,14 @@ import org.apache.cxf.tools.util.OutputStreamCreator;
 import org.apache.cxf.tools.wsdlto.WSDLToJava;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.sonatype.plexus.build.incremental.BuildContext;
 
-/**
- * @goal wsdl2java
- * @phase generate-sources
- * @description CXF WSDL To Java Tool
- * @requiresDependencyResolution test
- * @threadSafe
- */
+@Mojo(name = "wsdl2java", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true,
+      requiresDependencyResolution = ResolutionScope.TEST)
 public class WSDL2JavaMojo extends AbstractCodegenMoho {
 
     final class MavenToolErrorListener extends ToolErrorListener {
@@ -125,40 +124,35 @@ public class WSDL2JavaMojo extends AbstractCodegenMoho {
         }
     }
 
-    /**
-     * @parameter expression="${cxf.testSourceRoot}"
-     */
+    @Parameter(property = "cxf.testSourceRoot")
     File testSourceRoot;
 
     /**
      * Path where the generated sources should be placed
      * 
-     * @parameter expression="${cxf.sourceRoot}"
-     *            default-value="${project.build.directory}/generated-sources/cxf"
-     * @required
      */
+    @Parameter(required = true, defaultValue = "${project.build.directory}/generated-sources/cxf",
+               property = "cxf.sourceRoot")
     File sourceRoot;
 
     /**
      * Options that specify WSDLs to process and/or control the processing of wsdls. 
      * If you have enabled wsdl scanning, these elements attach options to particular wsdls.
      * If you have not enabled wsdl scanning, these options call out the wsdls to process.

-     * @parameter
      */
+    @Parameter
     WsdlOption wsdlOptions[];
 
     /**
      * Default options to be used when a wsdl has not had it's options explicitly specified.
-     * 
-     * @parameter
      */
+    @Parameter
     Option defaultOptions = new Option();
 
     /**
      * Encoding to use for generated sources
-     * 
-     * @parameter default-value="${project.build.sourceEncoding}"
      */
+    @Parameter(defaultValue = "${project.build.sourceEncoding}")
     String encoding;
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2js/WSDL2JavaScriptMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2js/WSDL2JavaScriptMojo.java
b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2js/WSDL2JavaScriptMojo.java
index 1ba97e3..daee4c9 100644
--- a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2js/WSDL2JavaScriptMojo.java
+++ b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2js/WSDL2JavaScriptMojo.java
@@ -39,44 +39,38 @@ import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.wsdlto.javascript.WSDLToJavaScript;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.maven.project.MavenProject;
 
-/**
- * @goal wsdl2js
- * @phase generate-sources
- * @description CXF WSDL To JavaScript Tool
- * @requiresDependencyResolution test
- * @threadSafe
- */
+@Mojo(name = "wsdl2js", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true,
+      requiresDependencyResolution = ResolutionScope.TEST)
 public class WSDL2JavaScriptMojo extends AbstractCodegenMoho {
 
-    /**
-     * @parameter expression="${cxf.testJavascriptRoot}"
-     */
+    @Parameter(property = "cxf.testJavascriptRoot")
     File testSourceRoot;
 
     /**
      * Path where the generated sources should be placed
-     * 
-     * @parameter expression="${cxf.sourceJavascriptRoot}"
-     *            default-value="${project.build.directory}/generated-sources/cxf-js"
-     * @required
      */
+    @Parameter(required = true, defaultValue = "${project.build.directory}/generated-sources/cxf-js",
+               property = "cxf.sourceJavascriptRoot")
     File sourceRoot;
 
     /**
      * Default options to be applied to all of the wsdls.
-     * 
-     * @parameter
      */
+    @Parameter
     Option defaultOptions = new Option();
     
     /**
      * Options that specify WSDLs to process and/or control the processing of wsdls. 
      * If you have enabled wsdl scanning, these elements attach options to particular wsdls.
      * If you have not enabled wsdl scanning, these options call out the wsdls to process.

-     * @parameter
      */
+    @Parameter
     WsdlOption wsdlOptions[];
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/corba/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/corba/pom.xml b/maven-plugins/corba/pom.xml
index 622932e..bf21633 100644
--- a/maven-plugins/corba/pom.xml
+++ b/maven-plugins/corba/pom.xml
@@ -69,41 +69,4 @@
             <version>${project.version}</version>
         </dependency>
     </dependencies>
-    <build>
-    	<pluginManagement>
-    		<plugins>
-    			<!--This plugin's configuration is used to store Eclipse m2e settings only. It
has no influence on the Maven build itself.-->
-    			<plugin>
-    				<groupId>org.eclipse.m2e</groupId>
-    				<artifactId>lifecycle-mapping</artifactId>
-    				<version>1.0.0</version>
-    				<configuration>
-    					<lifecycleMappingMetadata>
-    						<pluginExecutions>
-    							<pluginExecution>
-    								<pluginExecutionFilter>
-    									<groupId>
-    										org.apache.maven.plugins
-    									</groupId>
-    									<artifactId>
-    										maven-plugin-plugin
-    									</artifactId>
-    									<versionRange>
-    										[2.9,)
-    									</versionRange>
-    									<goals>
-    										<goal>descriptor</goal>
-    									</goals>
-    								</pluginExecutionFilter>
-    								<action>
-    									<ignore></ignore>
-    								</action>
-    							</pluginExecution>
-    						</pluginExecutions>
-    					</lifecycleMappingMetadata>
-    				</configuration>
-    			</plugin>
-    		</plugins>
-    	</pluginManagement>
-    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/java2wadl-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/java2wadl-plugin/pom.xml b/maven-plugins/java2wadl-plugin/pom.xml
index 03ea41e..78da0b1 100644
--- a/maven-plugins/java2wadl-plugin/pom.xml
+++ b/maven-plugins/java2wadl-plugin/pom.xml
@@ -118,6 +118,20 @@
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-javadoc-plugin</artifactId>
             <version>2.9.1</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.maven</groupId>
+                    <artifactId>maven-project</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.maven</groupId>
+                    <artifactId>maven-artifact-manager</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.maven</groupId>
+                    <artifactId>maven-toolchain</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <dependency>
@@ -194,42 +208,4 @@
             </build>
         </profile>
     </profiles>
-
-    <build>
-    	<pluginManagement>
-    		<plugins>
-    			<!--This plugin's configuration is used to store Eclipse m2e settings only. It
has no influence on the Maven build itself.-->
-    			<plugin>
-    				<groupId>org.eclipse.m2e</groupId>
-    				<artifactId>lifecycle-mapping</artifactId>
-    				<version>1.0.0</version>
-    				<configuration>
-    					<lifecycleMappingMetadata>
-    						<pluginExecutions>
-    							<pluginExecution>
-    								<pluginExecutionFilter>
-    									<groupId>
-    										org.apache.maven.plugins
-    									</groupId>
-    									<artifactId>
-    										maven-plugin-plugin
-    									</artifactId>
-    									<versionRange>
-    										[2.9,)
-    									</versionRange>
-    									<goals>
-    										<goal>descriptor</goal>
-    									</goals>
-    								</pluginExecutionFilter>
-    								<action>
-    									<ignore></ignore>
-    								</action>
-    							</pluginExecution>
-    						</pluginExecutions>
-    					</lifecycleMappingMetadata>
-    				</configuration>
-    			</plugin>
-    		</plugins>
-    	</pluginManagement>
-    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/ParseJavaDocMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/ParseJavaDocMojo.java
b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/ParseJavaDocMojo.java
index 9dd47f6..2662b7c 100644
--- a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/ParseJavaDocMojo.java
+++ b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/ParseJavaDocMojo.java
@@ -20,18 +20,20 @@ package org.apache.cxf.maven_plugin.javatowadl;
 
 import java.io.File;
 import java.lang.reflect.Field;
+import java.lang.reflect.Method;
 import java.util.List;
 import java.util.Locale;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugin.javadoc.AbstractJavadocMojo;
+import org.apache.maven.plugin.javadoc.JavadocReport;
 import org.apache.maven.plugin.javadoc.options.DocletArtifact;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.reporting.MavenReportException;
 import org.apache.maven.toolchain.ToolchainManager;
 import org.codehaus.plexus.archiver.manager.ArchiverManager;
 
@@ -41,7 +43,7 @@ import org.codehaus.plexus.archiver.manager.ArchiverManager;
  * @requiresDependencyResolution compile
  * @threadSafe
  */
-public class ParseJavaDocMojo extends AbstractJavadocMojo {
+public class ParseJavaDocMojo extends AbstractMojo {
 
     /**
      * @parameter expression="${project}"
@@ -118,24 +120,20 @@ public class ParseJavaDocMojo extends AbstractJavadocMojo {
 
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
-        if (skip) {
-            getLog().info("Skipping parse javadoc");
-            return;
-        }
-
+        AbstractJavadocMojo mojo = new JavadocReport();
+        Locale locale = Locale.getDefault();
         try {
-            Locale locale = Locale.getDefault();
             Field f = AbstractJavadocMojo.class.getDeclaredField("doclet");
             f.setAccessible(true);
-            f.set(this, "org.apache.cxf.maven_plugin.javatowadl.DumpJavaDoc");
+            f.set(mojo, "org.apache.cxf.maven_plugin.javatowadl.DumpJavaDoc");
 
             f = AbstractJavadocMojo.class.getDeclaredField("stylesheet");
             f.setAccessible(true);
-            f.set(this, "stylesheet");
+            f.set(mojo, "stylesheet");
             
             f = AbstractJavadocMojo.class.getDeclaredField("javadocOptionsDir");
             f.setAccessible(true);
-            f.set(this, javadocOptionsDir);
+            f.set(mojo, javadocOptionsDir);
 
             f = AbstractJavadocMojo.class.getDeclaredField("docletArtifact");
             f.setAccessible(true);
@@ -150,81 +148,68 @@ public class ParseJavaDocMojo extends AbstractJavadocMojo {
                     }
                 }
             }
-            f.set(this, docletArtifact);
+            f.set(mojo, docletArtifact);
 
             f = AbstractJavadocMojo.class.getDeclaredField("factory");
             f.setAccessible(true);
-            f.set(this, this.mavenArtifactFactory);
+            f.set(mojo, this.mavenArtifactFactory);
 
             f = AbstractJavadocMojo.class.getDeclaredField("mavenProjectBuilder");
             f.setAccessible(true);
-            f.set(this, this.mavenProjectBuilder);
+            f.set(mojo, this.mavenProjectBuilder);
 
             f = AbstractJavadocMojo.class.getDeclaredField("resolver");
             f.setAccessible(true);
-            f.set(this, this.artifactResolver);
+            f.set(mojo, this.artifactResolver);
 
             f = AbstractJavadocMojo.class.getDeclaredField("archiverManager");
             f.setAccessible(true);
-            f.set(this, this.archiverManager);
+            f.set(mojo, this.archiverManager);
 
             f = AbstractJavadocMojo.class.getDeclaredField("artifactMetadataSource");
             f.setAccessible(true);
-            f.set(this, this.artifactMetadataSource);
+            f.set(mojo, this.artifactMetadataSource);
 
             f = AbstractJavadocMojo.class.getDeclaredField("toolchainManager");
             f.setAccessible(true);
-            f.set(this, this.toolchainManager);
+            f.set(mojo, this.toolchainManager);
 
             f = AbstractJavadocMojo.class.getDeclaredField("localRepository");
             f.setAccessible(true);
-            f.set(this, this.localRepository);
+            f.set(mojo, this.localRepository);
 
             f = AbstractJavadocMojo.class.getDeclaredField("remoteRepositories");
             f.setAccessible(true);
-            f.set(this, this.remoteRepositories);
+            f.set(mojo, this.remoteRepositories);
 
             f = AbstractJavadocMojo.class.getDeclaredField("applyJavadocSecurityFix");
             f.setAccessible(true);
-            f.set(this, false);
+            f.set(mojo, false);
             
             f = AbstractJavadocMojo.class.getDeclaredField("additionalparam");
             f.setAccessible(true);
-            f.set(this, "-dumpJavaDocFile " + this.dumpFileOutputDirectory.getAbsolutePath()

+            f.set(mojo, "-dumpJavaDocFile " + this.dumpFileOutputDirectory.getAbsolutePath()

                       + File.separator + "dumpFile.properties");
 
-            useStandardDocletOptions = false;
-            this.project = mavenProject;
-            generate(locale);
-        } catch (Exception e) {
-            failOnError("An error has occurred in parsing javadoc", e);
-        }
-
-    }
-
-    private void generate(Locale locale) throws MavenReportException {
-        try {
-            outputDirectory = getReportOutputDirectory();
-            executeReport(locale);
-        } catch (MavenReportException e) {
-            if (failOnError) {
-                throw e;
-            }
-            getLog().error("Error while creating javadoc report: " + e.getMessage(), e);
-        } catch (RuntimeException e) {
-            if (failOnError) {
-                throw e;
+            f = AbstractJavadocMojo.class.getDeclaredField("useStandardDocletOptions");
+            f.setAccessible(true);
+            f.set(mojo, false);
+            
+            f = AbstractJavadocMojo.class.getDeclaredField("project");
+            f.setAccessible(true);
+            f.set(mojo, mavenProject);
+            
+            if (dumpFileOutputDirectory != null) {
+                f = AbstractJavadocMojo.class.getDeclaredField("outputDirectory");
+                f.setAccessible(true);
+                f.set(mojo, dumpFileOutputDirectory);
             }
-            getLog().error("Error while creating javadoc report: " + e.getMessage(), e);
-        }
-    }
-
-    private File getReportOutputDirectory() {
-        if (dumpFileOutputDirectory == null) {
-            return outputDirectory;
+        
+            Method m = AbstractJavadocMojo.class.getMethod("executeReport", Locale.class);
+            m.setAccessible(true);
+            m.invoke(mojo, locale);
+        } catch (Exception e) {
+            throw new MojoExecutionException("Failed to generate javadoc", e);
         }
-
-        return dumpFileOutputDirectory;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/java2ws-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/java2ws-plugin/pom.xml b/maven-plugins/java2ws-plugin/pom.xml
index d3ca92c..73c8ede 100644
--- a/maven-plugins/java2ws-plugin/pom.xml
+++ b/maven-plugins/java2ws-plugin/pom.xml
@@ -77,41 +77,4 @@
             <version>${project.version}</version>
         </dependency>
     </dependencies>
-    <build>
-    	<pluginManagement>
-    		<plugins>
-    			<!--This plugin's configuration is used to store Eclipse m2e settings only. It
has no influence on the Maven build itself.-->
-    			<plugin>
-    				<groupId>org.eclipse.m2e</groupId>
-    				<artifactId>lifecycle-mapping</artifactId>
-    				<version>1.0.0</version>
-    				<configuration>
-    					<lifecycleMappingMetadata>
-    						<pluginExecutions>
-    							<pluginExecution>
-    								<pluginExecutionFilter>
-    									<groupId>
-    										org.apache.maven.plugins
-    									</groupId>
-    									<artifactId>
-    										maven-plugin-plugin
-    									</artifactId>
-    									<versionRange>
-    										[2.9,)
-    									</versionRange>
-    									<goals>
-    										<goal>descriptor</goal>
-    									</goals>
-    								</pluginExecutionFilter>
-    								<action>
-    									<ignore></ignore>
-    								</action>
-    							</pluginExecution>
-    						</pluginExecutions>
-    					</lifecycleMappingMetadata>
-    				</configuration>
-    			</plugin>
-    		</plugins>
-    	</pluginManagement>
-    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/pom.xml b/maven-plugins/pom.xml
index 8a6f19b..57db354 100644
--- a/maven-plugins/pom.xml
+++ b/maven-plugins/pom.xml
@@ -39,24 +39,4 @@
         <module>corba</module>
         <module>archetypes</module>
     </modules>
-    <build>
-        <pluginManagement>
-            <plugins>
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-plugin-plugin</artifactId>
-                    <version>2.9</version>
-                </plugin>
-            </plugins>
-        </pluginManagement>
-    </build>
-    <reporting>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-plugin-plugin</artifactId>
-                <version>2.9</version>
-            </plugin>
-        </plugins>
-    </reporting>
 </project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/wadl2java-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/wadl2java-plugin/pom.xml b/maven-plugins/wadl2java-plugin/pom.xml
index 092d859..1e10e63 100644
--- a/maven-plugins/wadl2java-plugin/pom.xml
+++ b/maven-plugins/wadl2java-plugin/pom.xml
@@ -56,6 +56,11 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.maven.plugin-tools</groupId>
+            <artifactId>maven-plugin-annotations</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-utils</artifactId>
             <version>2.0.5</version>
@@ -122,41 +127,4 @@
             </dependencies>
         </profile>
     </profiles>
-    <build>
-    	<pluginManagement>
-    		<plugins>
-    			<!--This plugin's configuration is used to store Eclipse m2e settings only. It
has no influence on the Maven build itself.-->
-    			<plugin>
-    				<groupId>org.eclipse.m2e</groupId>
-    				<artifactId>lifecycle-mapping</artifactId>
-    				<version>1.0.0</version>
-    				<configuration>
-    					<lifecycleMappingMetadata>
-    						<pluginExecutions>
-    							<pluginExecution>
-    								<pluginExecutionFilter>
-    									<groupId>
-    										org.apache.maven.plugins
-    									</groupId>
-    									<artifactId>
-    										maven-plugin-plugin
-    									</artifactId>
-    									<versionRange>
-    										[2.9,)
-    									</versionRange>
-    									<goals>
-    										<goal>descriptor</goal>
-    									</goals>
-    								</pluginExecutionFilter>
-    								<action>
-    									<ignore></ignore>
-    								</action>
-    							</pluginExecution>
-    						</pluginExecutions>
-    					</lifecycleMappingMetadata>
-    				</configuration>
-    			</plugin>
-    		</plugins>
-    	</pluginManagement>
-    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/AbstractCodeGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/AbstractCodeGeneratorMojo.java
b/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/AbstractCodeGeneratorMojo.java
index fe5454d..16e7f84 100644
--- a/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/AbstractCodeGeneratorMojo.java
+++ b/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/AbstractCodeGeneratorMojo.java
@@ -47,6 +47,8 @@ import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Resource;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.repository.RepositorySystem;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
@@ -60,54 +62,42 @@ import org.codehaus.plexus.util.cli.Commandline;
 public abstract class AbstractCodeGeneratorMojo extends AbstractMojo {
 
     /**
-     * @parameter expression="${cxf.testSourceRoot}"
+     * Source Root
      */
+	@Parameter(property = "cxf.testSourceRoot")
     File testSourceRoot;
 
     /**
      * Path where the generated sources should be placed
-     * 
-     * @parameter expression="${cxf.sourceRoot}"
-     *            default-value="${project.build.directory}/generated-sources/cxf"
-     * @required
      */
+    @Parameter(required = true,
+            property = "cxf.sourceRoot",
+            defaultValue = "${project.build.directory}/generated-sources/cxf")
     File sourceRoot;
 
-    /**
-     * @parameter expression="${project.build.outputDirectory}"
-     * @required
-     */
+    @Parameter(required = true, property = "project.build.outputDirectory")
     String classesDirectory;
 
-    /**
-     * @parameter expression="${project}"
-     * @required
-     */
+    @Parameter(required = true, property = "project")
     MavenProject project;
 
     /**
      * Default options to be used when a wadl has not had it's options explicitly specified.
-     * 
-     * @parameter
      */
+    @Parameter
     Option defaultOptions = new Option();
 
-    
-
     /**
      * Directory in which the "DONE" markers are saved that
-     * 
-     * @parameter expression="${cxf.markerDirectory}"
-     *            default-value="${project.build.directory}/cxf-codegen-plugin-markers"
      */
+    @Parameter(property = "cxf.markerDirectory", defaultValue = "${project.build.directory}/cxf-codegen-plugin-markers")
     File markerDirectory;
 
     /**
      * Use the compile classpath rather than the test classpath for execution useful if the
test dependencies
      * clash with those of wadl2java
-     * 
-     * @parameter expression="${cxf.useCompileClasspath}" default-value="false"
      */
+    @Parameter(property = "cxf.useCompileClasspath", defaultValue = "false")
     boolean useCompileClasspath;
     
     
@@ -116,94 +106,69 @@ public abstract class AbstractCodeGeneratorMojo extends AbstractMojo
{
      * By default, we scan for *.wadl (see include/exclude params as well) in the wadlRoot
      * directories and run wadl2java on all the wadl's we find.    This disables that scan
      * and requires an explicit wadlOption to be set for each wadl that needs to be processed.
-     * @parameter expression="${cxf.disableDirectoryScan}" default-value="false"
      */
+    @Parameter(property = "cxf.disableDirectoryScan", defaultValue = "false")
     boolean disableDirectoryScan;
 
     /**
      * By default all maven dependencies of type "wadl" are added to the effective wadlOptions.
Setting this
      * parameter to true disables this functionality
-     * 
-     * @parameter expression="${cxf.disableDependencyScan}" default-value="false"
      */
+    @Parameter(property = "cxf.disableDependencyScan", defaultValue = "false")
     boolean disableDependencyScan;
 
     /**
      * A list of wadl files to include. Can contain ant-style wildcards and double wildcards.
Defaults to
      * *.wadl
-     * 
-     * @parameter
      */
+    @Parameter
     String includes[];
 
     /**
      * A list of wadl files to exclude. Can contain ant-style wildcards and double wildcards.
-     * 
-     * @parameter
      */
+    @Parameter
     String excludes[];
 
     /**
      * Allows running the JavaToWs in a separate process.
      * Valid values are "false", "always", and "once"
      * The value of "true" is equal to "once"
-     *
-     * @parameter default-value="false"
-     * @since 2.4
      */
+    @Parameter(defaultValue = "false")
     String fork;
     
     /**
      * The Maven session.
-     * 
-     * @parameter expression="${session}"
-     * @readonly
-     * @required
      */
+    @Parameter(readonly = true, required = true, property = "session")
     private MavenSession mavenSession;
 
     /**
      * The plugin dependencies, needed for the fork mode.
-     *
-     * @parameter expression="${plugin.artifacts}"
-     * @required
-     * @readonly
      */
+    @Parameter(readonly = true, required = true, property = "plugin.artifacts")
     private List<Artifact> pluginArtifacts;
     
 
     /**
      * Sets the Java executable to use when fork parameter is <code>true</code>.
-     *
-     * @parameter default-value="${java.home}/bin/java"
-     * @since 2.4
      */
+    @Parameter(defaultValue = "${java.home}/bin/java")
     private String javaExecutable;
 
     /**
      * Sets the JVM arguments (i.e. <code>-Xms128m -Xmx128m</code>) if fork is
set to <code>true</code>.
-     *
-     * @parameter
-     * @since 2.4
      */
+    @Parameter
     private String additionalJvmArgs;
     
-    /**
-     * @component
-     * @readonly
-     * @required
-     */
+    @Component
     private RepositorySystem repositorySystem;
     
     
     private ClassLoader resourceClassLoader;
-    
-    /**
-     * Merge WadlOptions that point to the same file by adding the extraargs to the first
option and deleting
-     * the second from the options list
-     * 
-     * @param options
-     */
+
     
     private Artifact resolveRemoteWadlArtifact(Artifact artifact)
         throws MojoExecutionException {

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/WADL2JavaMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/WADL2JavaMojo.java
b/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/WADL2JavaMojo.java
index 58503b9..c8280f2 100644
--- a/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/WADL2JavaMojo.java
+++ b/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/WADL2JavaMojo.java
@@ -28,34 +28,31 @@ import java.util.Set;
 import org.apache.cxf.Bus;
 import org.apache.cxf.maven_plugin.common.ClassLoaderSwitcher;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.sonatype.plexus.build.incremental.BuildContext;
 
 
 /**
- * @goal wadl2java
- * @phase generate-sources
- * @description CXF WADL To Java Tool
- * @requiresDependencyResolution test
- * @threadSafe
+ * CXF WADL To Java Tool
  */
+@Mojo(name = "wadl2java", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true,
+      requiresDependencyResolution = ResolutionScope.TEST)
 public class WADL2JavaMojo extends AbstractCodeGeneratorMojo {
-    /**
-     * @parameter
-     */
-    WadlOption wadlOptions[];
+    @Parameter
+	WadlOption wadlOptions[];
 
-    /**
-     * @parameter expression="${cxf.wadlRoot}" default-value="${basedir}/src/main/resources/wadl"
-     */
+    @Parameter(property = "cxf.wadlRoot", defaultValue = "${basedir}/src/main/resources/wad")
     File wadlRoot;
 
-    /**
-     * @parameter expression="${cxf.testWadlRoot}" default-value="${basedir}/src/test/resources/wadl"
-     */
+    @Parameter(property = "cxf.testWadlRoot", defaultValue = "${basedir}/src/test/resources/wadl")
     File testWadlRoot;
     
     
-    /** @component */
+    @Component
     BuildContext buildContext;
     
     private void mergeOptions(List<WadlOption> effectiveOptions) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/maven-plugins/wsdl-validator-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugins/wsdl-validator-plugin/pom.xml b/maven-plugins/wsdl-validator-plugin/pom.xml
index afa83f9..12658aa 100644
--- a/maven-plugins/wsdl-validator-plugin/pom.xml
+++ b/maven-plugins/wsdl-validator-plugin/pom.xml
@@ -56,41 +56,4 @@
             <version>${project.version}</version>
         </dependency>
     </dependencies>
-    <build>
-    	<pluginManagement>
-    		<plugins>
-    			<!--This plugin's configuration is used to store Eclipse m2e settings only. It
has no influence on the Maven build itself.-->
-    			<plugin>
-    				<groupId>org.eclipse.m2e</groupId>
-    				<artifactId>lifecycle-mapping</artifactId>
-    				<version>1.0.0</version>
-    				<configuration>
-    					<lifecycleMappingMetadata>
-    						<pluginExecutions>
-    							<pluginExecution>
-    								<pluginExecutionFilter>
-    									<groupId>
-    										org.apache.maven.plugins
-    									</groupId>
-    									<artifactId>
-    										maven-plugin-plugin
-    									</artifactId>
-    									<versionRange>
-    										[2.9,)
-    									</versionRange>
-    									<goals>
-    										<goal>descriptor</goal>
-    									</goals>
-    								</pluginExecutionFilter>
-    								<action>
-    									<ignore></ignore>
-    								</action>
-    							</pluginExecution>
-    						</pluginExecutions>
-    					</lifecycleMappingMetadata>
-    				</configuration>
-    			</plugin>
-    		</plugins>
-    	</pluginManagement>
-    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 0d2678c..5d1f914 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -724,6 +724,18 @@
                 </exclusions>
             </dependency>
             <dependency>
+                <groupId>org.apache.maven.plugin-tools</groupId>
+                <artifactId>maven-plugin-annotations</artifactId>
+                <version>3.4</version>
+                <scope>provided</scope>
+                <exclusions>
+                    <exclusion>
+                        <groupId>junit</groupId>
+                        <artifactId>junit</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
                 <groupId>org.apache.mina</groupId>
                 <artifactId>mina-core</artifactId>
                 <version>${cxf.mina.version}</version>

http://git-wip-us.apache.org/repos/asf/cxf/blob/96ed8050/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0873d69..31debe6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -615,6 +615,37 @@
                         </dependency>
                     </dependencies>
                 </plugin>
+                <!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself.-->
+                <plugin>
+                	<groupId>org.eclipse.m2e</groupId>
+                	<artifactId>lifecycle-mapping</artifactId>
+                	<version>1.0.0</version>
+                	<configuration>
+                		<lifecycleMappingMetadata>
+                			<pluginExecutions>
+                				<pluginExecution>
+                					<pluginExecutionFilter>
+                						<groupId>
+                							org.apache.maven.plugins
+                						</groupId>
+                						<artifactId>
+                							maven-plugin-plugin
+                						</artifactId>
+                						<versionRange>
+                							[3.4,)
+                						</versionRange>
+                						<goals>
+                							<goal>descriptor</goal>
+                						</goals>
+                					</pluginExecutionFilter>
+                					<action>
+                						<ignore></ignore>
+                					</action>
+                				</pluginExecution>
+                			</pluginExecutions>
+                		</lifecycleMappingMetadata>
+                	</configuration>
+                </plugin>
             </plugins>
         </pluginManagement>
     </build>


Mime
View raw message