You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Richard Sand (JIRA)" <ji...@apache.org> on 2016/05/14 02:25:12 UTC

[jira] [Updated] (MJAVADOC-451) Add "skip" option to javadoc:fix goal

     [ https://issues.apache.org/jira/browse/MJAVADOC-451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Sand updated MJAVADOC-451:
----------------------------------
    Attachment: skip.patch

> Add "skip" option to javadoc:fix goal
> -------------------------------------
>
>                 Key: MJAVADOC-451
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-451
>             Project: Maven Javadoc Plugin
>          Issue Type: Improvement
>          Components: javadoc
>    Affects Versions: 2.10.3
>         Environment: all
>            Reporter: Richard Sand
>            Priority: Trivial
>             Fix For: 2.10.4
>
>         Attachments: skip.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I've a project where we want to use the javadoc:fix goal in a non-interactive (forced) mode. I know this isn't recommended usage but we have specific reasons for this particular project. It is useful to have a parameter to tell maven to skip this goal if desired. Many other goals/plugins have a skip parameter, so I added one called "maven.javadoc.fix.skip".
> I've provided a patch here to add this parameter. Its a trivial enough patch that I hope you'll allow it for 2.10.4. Thanks!
> Index: src/main/java/org/apache/maven/plugin/javadoc/AbstractFixJavadocMojo.java
> ===================================================================
> --- src/main/java/org/apache/maven/plugin/javadoc/AbstractFixJavadocMojo.java	(revision 1743597)
> +++ src/main/java/org/apache/maven/plugin/javadoc/AbstractFixJavadocMojo.java	(working copy)
> @@ -365,6 +365,14 @@
>      @Parameter( defaultValue = "${settings}", readonly = true, required = true )
>      private Settings settings;
>  
> +    /**
> +     * Specifies whether the Javadoc fix should be skipped.
> +     *
> +     * @since 2.10.4
> +     */
> +    @Parameter( property = "maven.javadoc.fix.skip", defaultValue = "false" )
> +    protected boolean skip;
> +
>      // ----------------------------------------------------------------------
>      // Internal fields
>      // ----------------------------------------------------------------------
> @@ -402,6 +410,12 @@
>      public void execute()
>          throws MojoExecutionException, MojoFailureException
>      {
> +        if ( skip )
> +        {
> +            getLog().info( "Skipping javadoc generation" );
> +            return;
> +        }
> +        
>          if ( !fixClassComment && !fixFieldComment && !fixMethodComment )
>          {
>              getLog().info( "Specified to NOT fix classes, fields and methods. Nothing to do." );



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)