如何合并方法和描述列

huangapple go评论71阅读模式
英文:

How to merge method and description columns

问题

I'm new to javadoc. I've tried to generate javadoc with Maven plugin. It works well, however, it generates 2 columns Method and Description instead 1 column Method and Description. I can't find an option to merge these 2 columns.

Here is the config in the pom file:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-javadoc-plugin</artifactId>
      <version>3.5.0</version>
      <configuration>
        <source>1.8</source>
        <target>1.8</target>
      </configuration>
    </plugin>
  </plugins>
</build>

And, here is the result:

如何合并方法和描述列

What I would expect:

如何合并方法和描述列

英文:

I'm new to javadoc. I've tried to generate javadoc with Maven plugin. It works well, however, it generates 2 columns Method and Description instead 1 column Method and Description. I can't find option to merge these 2 columns.

Here is the config in the pom file:

&lt;build&gt;
  &lt;plugins&gt;
    &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.5.0&lt;/version&gt;
      &lt;configuration&gt;
        &lt;source&gt;1.8&lt;/source&gt;
        &lt;target&gt;1.8&lt;/target&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  &lt;/plugins&gt;
&lt;/build&gt;

And, here is the result:

如何合并方法和描述列

What I would expect:

如何合并方法和描述列

答案1

得分: 1

默认情况下,Maven Javadoc 插件生成的 Javadoc 具有两列:方法和描述。但是,如果您想将这两列合并为单独的一列,您可以使用<noindex>true</noindex>配置选项。

通过添加<additionalparam>-noindex</additionalparam>配置,您正在将-noindex选项传递给Javadoc工具,这将导致方法和描述的单列布局。

在进行此更改后,您可以通过运行Maven命令mvn javadoc:javadoc重新生成Javadoc。生成的Javadoc现在应该具有方法和描述的单列。

英文:

By default, the Maven Javadoc plugin generates Javadoc with two columns: Method and Description. However, if you want to merge these two columns into a single column, you can use the &lt;noindex&gt;true&lt;/noindex&gt; configuration option.

&lt;build&gt;
  &lt;plugins&gt;
    &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.5.0&lt;/version&gt;
      &lt;configuration&gt;
        &lt;source&gt;1.8&lt;/source&gt;
        &lt;target&gt;1.8&lt;/target&gt;
        &lt;additionalparam&gt;-noindex&lt;/additionalparam&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  &lt;/plugins&gt;
&lt;/build&gt;

By adding the &lt;additionalparam&gt;-noindex&lt;/additionalparam&gt; configuration, you are passing the -noindex option to the Javadoc tool, which will result in a single column layout for the Method and Description.

After making this change, you can regenerate the Javadoc by running the Maven command mvn javadoc:javadoc. The generated Javadoc should now have a single column for Method and Description.

huangapple
  • 本文由 发表于 2023年6月1日 11:39:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76378544.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定