apache / apache/maven-plugin-tools

[MPLUGIN-535] maven-plugin-plugin clobbers code block formatting

Open
#845 0 comments 0 reactions 0 assignees View on GitHub
bug priority:minor
Dominant language
Java
Stars
64
Forks
71
Avg merge
12h 24m
Merged PRs (30d)
32

Description

**[Ashley Scopes](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER291213)** opened **[MPLUGIN-535](https://issues.apache.org/jira/browse/MPLUGIN-535?redirect=false)** and commented

If a plugin parameter JavaDoc provides a code example within a \

 HTML tag, then it appears that the generated Help Mojo discards this information and renders the content inline, discarding whitespace detail. This results in examples being incorrectly formatted in the help goal.

ewer versions of Java introduce a snippet doclet that can replace this but this is not available within Java 11 releases of JavaDoc, so \

 needs to be respected as well.

Example output:

```
[INFO] For example:
[INFO]
[INFO] ftp://myorganisation.org/protoc/plugins/myplugin.exe
[INFO]
[INFO]
[INFO] https://myorganisation.org/protoc/plugins/myplugin2.exe
[INFO] foo=bar,baz=bork
[INFO] jar:https://myorganisation.org/protoc/plugins/myplugin3.zip!/protoc-gen-something.exe
[INFO]
[INFO] Objects support the following attributes:
```

Produced from the following JavaDoc comment (which renders with correct formatting if using JavaDoc itself):

```
/**
* Binary plugins to use with the protobuf compiler, specified as a valid URL.
*
*

This includes support for:
*
*


    *
  • Local file system objects, specified using {@code file://path/to/file}

  • *
  • HTTP resources, specified using {@code http://example.website/path/to/file}

  • *
  • HTTPS resources, specified using {@code https://example.website/path/to/file}

  • *
  • FTP resources, specified using {@code ftp://example.server/path/to/file}

  • *

*
*

Additionally, the {@code jar} protocol can be used with any of the above to
* enable extracting a file from a JAR or ZIP and using it directly.
*
*

For example:
*

{@code

*
*
*
* ftp://myorganisation.org/protoc/plugins/myplugin.exe
*
*
*
*
* https://myorganisation.org/protoc/plugins/myplugin2.exe
* foo=bar,baz=bork
*
*
*
*
* jar:https://myorganisation.org/protoc/plugins/myplugin3.zip!/protoc-gen-something.exe
*
*
* }

*
*

Objects support the following attributes:
*
*


    *
  • {@code url} - the URL to resolve.

  • *
  • {@code options} - a string of options to pass to the plugin
    * - optional.

  • *
  • {@code order} - an integer order to run the plugins in. Defaults
    * to 100,000. Higher numbers run later than lower numbers.

  • *
  • {@code skip} - set to {@code true} to skip invoking this plugin -
    * useful if you want to control whether the plugin runs via a
    * property - optional.

  • *

*
* @since 2.0.0
*/
@Parameter
@Nullable List binaryUrlPlugins;
```

See https://github.com/ascopes/protobuf-maven-plugin/blob/main/protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/mojo/AbstractGenerateMojo.java#L232 for a reproduction.

---
No further details from [MPLUGIN-535](https://issues.apache.org/jira/browse/MPLUGIN-535?redirect=false)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.