GroovyDoc 作为 Maven 插件

发布于 2024-10-22 03:10:26 字数 1354 浏览 0 评论 0原文

是否有可用的 Maven 插件使用 GroovyDoc,最好是作为报告?

我想 GMaven 会是一个值得一看的地方,但文档很古老(1.0,而当前版本是 1.3)并且 GMaven 插件没有任何适合的魔力,如您所见:

mvn help:describe -DgroupId=org.codehaus.gmaven -DartifactId=gmaven-plugin

这个插件有 9 个目标:

groovy:编译
描述:编译 Groovy 来源。

groovy:控制台
描述: 发射 Groovy GUI 控制台。

groovy:执行
描述:执行 Groovy 脚本。

groovy:generateStubs
描述: 从 Groovy 生成 Java 存根 来源。

groovy:generateTestStubs
描述:生成 Java 存根 Groovy 测试源。

groovy:帮助
描述:显示 有关 gmaven-plugin 的帮助信息。
致电
mvn groovy:help -Ddetail=true -Dgoal=<目标名称>
显示参数详细信息。

groovy:providers
描述: 显示有关 Groovy 的信息 运行时提供者 已配置并选择。

groovy:shell
描述: 发射 Groovy Shell(又名 groovysh)。

groovy:testCompile
描述: 编译 Groovy 测试源。

那么有人有任何指向 Maven groovydoc 插件的指示吗?谷歌没有想出任何有意义的东西。

Is there a maven plugin available somewhere that utilizes GroovyDoc, preferably as a report?

I guess GMaven would be the place to look but the docs are ancient (1.0, whereas the current version is 1.3) and the GMaven plugin doesn't have any mojo that fits as you can see:

mvn help:describe -DgroupId=org.codehaus.gmaven -DartifactId=gmaven-plugin

This plugin has 9 goals:

groovy:compile
Description: Compiles
Groovy sources.

groovy:console
Description: Launches
the Groovy GUI console.

groovy:execute
Description: Executes
a Groovy script.

groovy:generateStubs
Description:
Generate Java stubs from Groovy
sources.

groovy:generateTestStubs
Description: Generate Java stubs from
Groovy test sources.

groovy:help
Description: Display
help information on gmaven-plugin.
Call
mvn groovy:help -Ddetail=true -Dgoal=<goal-name>
to display parameter details.

groovy:providers
Description:
Displays information about the Groovy
runtime providers which
are configured and selected.

groovy:shell
Description: Launches
the Groovy Shell (aka. groovysh).

groovy:testCompile
Description:
Compiles Groovy test sources.

So does anyone have any pointers to a maven groovydoc plugin? Google didn't come up with anything meaningful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

謸气贵蔟 2024-10-29 03:10:26

尽管没有任何 Groovydoc maven 兼容插件,但使用 Maven 为您的 groovy 类生成文档非常容易。这就是我们在项目中所做的方式:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-antrun-plugin</artifactId>
  <version>1.7</version>
  <executions>
    <execution>
      <id>groovydoc</id>
      <phase>site</phase>
      <goals>
        <goal>run</goal>
      </goals>
      <configuration>
        <target>
          <taskdef name="groovydoc"
            classname="org.codehaus.groovy.ant.Groovydoc" 
            classpathref="maven.compile.classpath"
          />
          <groovydoc destdir="${project.reporting.outputDirectory}/groovydoc"
            sourcepath="${basedir}/src/main/groovy" use="true"
            windowtitle="${project.name}"
            doctitle="${project.name}"
          >
            <link packages="java.,org.xml.,javax.,org.xml."
              href="http://download.oracle.com/javase/6/docs/api" />
            <link packages="org.apache.tools.ant." 
              href="http://evgeny-goldin.org/javadoc/ant/api" />
            <link packages="org.junit.,junit.framework."
              href="http://kentbeck.github.com/junit/javadoc/latest" />
            <link packages="groovy.,org.codehaus.groovy."
              href="http://groovy.codehaus.org/api/" />
            <link packages="org.codehaus.gmaven."
              href="http://evgeny-goldin.org/javadoc/gmaven" />
          </groovydoc>
        </target>
      </configuration>
    </execution>
  </executions>
</plugin>

Although there is not any Groovydoc maven compatible plugin, generating the documentation for your groovy classes is quite easy using Maven. This is the way we do in our projects:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-antrun-plugin</artifactId>
  <version>1.7</version>
  <executions>
    <execution>
      <id>groovydoc</id>
      <phase>site</phase>
      <goals>
        <goal>run</goal>
      </goals>
      <configuration>
        <target>
          <taskdef name="groovydoc"
            classname="org.codehaus.groovy.ant.Groovydoc" 
            classpathref="maven.compile.classpath"
          />
          <groovydoc destdir="${project.reporting.outputDirectory}/groovydoc"
            sourcepath="${basedir}/src/main/groovy" use="true"
            windowtitle="${project.name}"
            doctitle="${project.name}"
          >
            <link packages="java.,org.xml.,javax.,org.xml."
              href="http://download.oracle.com/javase/6/docs/api" />
            <link packages="org.apache.tools.ant." 
              href="http://evgeny-goldin.org/javadoc/ant/api" />
            <link packages="org.junit.,junit.framework."
              href="http://kentbeck.github.com/junit/javadoc/latest" />
            <link packages="groovy.,org.codehaus.groovy."
              href="http://groovy.codehaus.org/api/" />
            <link packages="org.codehaus.gmaven."
              href="http://evgeny-goldin.org/javadoc/gmaven" />
          </groovydoc>
        </target>
      </configuration>
    </execution>
  </executions>
</plugin>
蒲公英的约定 2024-10-29 03:10:26

您需要 gmavenplus 插件: http://groovy.github.io/GMavenPlus/groovydoc- mojo.html

<project>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>1.5</version>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <!-- any version of Groovy \>= 1.5.0 (except 1.6 RC 1) should work here -->
      <version>2.4.7</version>
    </dependency>
  </dependencies>
</project>

并运行:mvn gplus:generateStubs gplus:groovydoc

You want the gmavenplus plugin: http://groovy.github.io/GMavenPlus/groovydoc-mojo.html

<project>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>1.5</version>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <!-- any version of Groovy \>= 1.5.0 (except 1.6 RC 1) should work here -->
      <version>2.4.7</version>
    </dependency>
  </dependencies>
</project>

and run: mvn gplus:generateStubs gplus:groovydoc

野鹿林 2024-10-29 03:10:26

I don't think there is a Maven plugin for Groovydoc, but you can use the Ant task. GMaven follows a different approach: generateStubs creates Java stubs for Groovy classes, which can then be processed by the regular Javadoc plugin. However, I don't know how well this approach works in practice, in particular because newer versions of GMaven use the Groovy compiler's stub generator, which wasn't created with the goal of producing proper Javadoc in mind.

寂寞花火° 2024-10-29 03:10:26

Groovydoc Maven 插件对我有用: https://github.com/rvowles/groovydoc-maven-plugin

The Groovydoc Maven Plugin worked for me: https://github.com/rvowles/groovydoc-maven-plugin

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文