Return-Path: X-Original-To: apmail-cxf-dev-archive@www.apache.org Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5C31B17862 for ; Tue, 3 Feb 2015 09:36:08 +0000 (UTC) Received: (qmail 18410 invoked by uid 500); 3 Feb 2015 09:36:09 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 18344 invoked by uid 500); 3 Feb 2015 09:36:09 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 17846 invoked by uid 99); 3 Feb 2015 09:35:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2015 09:35:34 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of elakito@gmail.com designates 209.85.215.50 as permitted sender) Received: from [209.85.215.50] (HELO mail-la0-f50.google.com) (209.85.215.50) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2015 09:35:07 +0000 Received: by mail-la0-f50.google.com with SMTP id hs14so49522855lab.9 for ; Tue, 03 Feb 2015 01:34:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=4ivbm17FKa2eJ9cglXaEldQF3r9KJh+7kyetRh6JTiI=; b=x57l7JGDKa+T0z0ABMLNq5xi/PA8u0+2hi0zdK1OV0tbmvS16UFIfuwWpTNUAAsQ+M kStV60LV9CWk1YK9pnlYhHB+CaTddK5iT448KrfL+u5BGlUH3zabCFHz+Pn8YfRPnmnI BwnP4fZxPrrvF2TY4BZUaPSgp6sBUpVAWFl664oqhTwlOc3hD+JGAhibqZ9HptDfBzPw BIxGdUF9IT7ya4BEySjG3dM7MbloX8i+5u3TXOrhf2P8UeH7lRYhr/KNrC+ZK2OMrhUu TNePPEQPRtWciOlA7/4AzxjVuiFOnG/tXkfHLf8S4Jd/6+uhlZ5Kj2yHcG0eIO00ENzc Stww== MIME-Version: 1.0 X-Received: by 10.152.6.37 with SMTP id x5mr23446332lax.44.1422956060563; Tue, 03 Feb 2015 01:34:20 -0800 (PST) Received: by 10.25.158.136 with HTTP; Tue, 3 Feb 2015 01:34:20 -0800 (PST) In-Reply-To: <2dbf8f5c677d4a70a2ffa94258b0c071@git.apache.org> References: <2dbf8f5c677d4a70a2ffa94258b0c071@git.apache.org> Date: Tue, 3 Feb 2015 10:34:20 +0100 Message-ID: Subject: Re: [1/5] cxf git commit: Update plugins to use annotations instead of the javadoc things From: Aki Yoshida To: dev@cxf.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org It looks like this commit has broken cxf-codegen-plugin in trunk. [INFO] Apache CXF Command Line Tools WSDL to JavaScript Front End SUCCESS [2.062s] [INFO] Apache CXF Command Line Tools WSDLTo JAXB Databinding SUCCESS [1.981s] [INFO] Apache CXF Maven Plugins .......................... SUCCESS [0.057s] [INFO] Apache CXF WSDL Validator Maven2 Plugin ........... SUCCESS [1.751s] [INFO] Apache CXF Code Generation Maven2 Plugins ......... FAILURE [0.784s] [INFO] Apache CXF Test Utilities ......................... SKIPPED ... Does anyone know how to fix it or do we have to wait for Dan? I just temporarily synch'ed my local branch to one commit earlier to get the build run. regards, aki 2015-02-02 19:59 GMT+01:00 : > 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 > Authored: Mon Feb 2 13:58:09 2015 -0500 > Committer: Daniel Kulp > 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 @@ > provided > > > + org.apache.maven.plugin-tools > + maven-plugin-annotations > + provided > + > + > org.codehaus.plexus > plexus-utils > 2.0.5 > @@ -148,41 +153,4 @@ > > > > - > - > - > - > - > - org.eclipse.m2e > - lifecycle-mapping > - 1.0.0 > - > - > - > - > - > - > - org.apache.maven.plugins > - > - > - maven-plugin-plugin > - > - > - [2.9,) > - > - > - descriptor > - > - > - > - > - > - > - > - > - > - > - > - > - > > > 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 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. -Xms128m -Xmx128m) if fork is set to true. > - * > - * @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 true. > - * > - * @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 @@ > ${project.version} > > > - > - > - > - > - > - org.eclipse.m2e > - lifecycle-mapping > - 1.0.0 > - > - > - > - > - > - > - org.apache.maven.plugins > - > - > - maven-plugin-plugin > - > - > - [2.9,) > - > - > - descriptor > - > - > - > - > - > - > - > - > - > - > - > - > - > > > 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 @@ > org.apache.maven.plugins > maven-javadoc-plugin > 2.9.1 > + > + > + org.apache.maven > + maven-project > + > + > + org.apache.maven > + maven-artifact-manager > + > + > + org.apache.maven > + maven-toolchain > + > + > > > > @@ -194,42 +208,4 @@ > > > > - > - > - > - > - > - > - org.eclipse.m2e > - lifecycle-mapping > - 1.0.0 > - > - > - > - > - > - > - org.apache.maven.plugins > - > - > - maven-plugin-plugin > - > - > - [2.9,) > - > - > - descriptor > - > - > - > - > - > - > - > - > - > - > - > - > - > > > 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 @@ > ${project.version} > > > - > - > - > - > - > - org.eclipse.m2e > - lifecycle-mapping > - 1.0.0 > - > - > - > - > - > - > - org.apache.maven.plugins > - > - > - maven-plugin-plugin > - > - > - [2.9,) > - > - > - descriptor > - > - > - > - > - > - > - > - > - > - > - > - > - > > > 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 @@ > corba > archetypes > > - > - > - > - > - org.apache.maven.plugins > - maven-plugin-plugin > - 2.9 > - > - > - > - > - > - > - > - org.apache.maven.plugins > - maven-plugin-plugin > - 2.9 > - > - > - > > > 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 @@ > provided > > > + org.apache.maven.plugin-tools > + maven-plugin-annotations > + provided > + > + > org.codehaus.plexus > plexus-utils > 2.0.5 > @@ -122,41 +127,4 @@ > > > > - > - > - > - > - > - org.eclipse.m2e > - lifecycle-mapping > - 1.0.0 > - > - > - > - > - > - > - org.apache.maven.plugins > - > - > - maven-plugin-plugin > - > - > - [2.9,) > - > - > - descriptor > - > - > - > - > - > - > - > - > - > - > - > - > - > > > 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 pluginArtifacts; > > > /** > * Sets the Java executable to use when fork parameter is true. > - * > - * @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. -Xms128m -Xmx128m) if fork is set to true. > - * > - * @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 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 @@ > ${project.version} > > > - > - > - > - > - > - org.eclipse.m2e > - lifecycle-mapping > - 1.0.0 > - > - > - > - > - > - > - org.apache.maven.plugins > - > - > - maven-plugin-plugin > - > - > - [2.9,) > - > - > - descriptor > - > - > - > - > - > - > - > - > - > - > - > - > - > > > 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 @@ > > > > + org.apache.maven.plugin-tools > + maven-plugin-annotations > + 3.4 > + provided > + > + > + junit > + junit > + > + > + > + > org.apache.mina > mina-core > ${cxf.mina.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 @@ > > > > + > + > + org.eclipse.m2e > + lifecycle-mapping > + 1.0.0 > + > + > + > + > + > + > + org.apache.maven.plugins > + > + > + maven-plugin-plugin > + > + > + [3.4,) > + > + > + descriptor > + > + > + > + > + > + > + > + > + > + > > > >