# How to generate Groovydoc of Plugin

**URL:** <https://forum.katalon.com/t/how-to-generate-groovydoc-of-plugin/21028>\
**Category:** Integrations\
**Tags:** plugins, katalon-studio\
**Created:** [March 12, 2019, 9:34pm UTC](https://forum.katalon.com/t/how-to-generate-groovydoc-of-plugin/21028 "2019-03-12T21:34:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 12, 2019, 9:34pm UTC](https://forum.katalon.com/t/how-to-generate-groovydoc-of-plugin/21028/1 "2019-03-12T21:34:33Z")

</div>

I am preparing [junit4ks](https://github.com/kazurayam/junit4ks) as a Katalon plugin. I wanted to publish the API doc of junit4ks generated by Groovydoc. Here is [the link to it](https://kazurayam.github.io/junit4ks/api/index.html) on GitHub. I needed to change my `junit4ks/build.gradle` to generate the groovydoc. Here I would show it.

```auto
plugins {
    id 'java'
    id 'groovy'
    id 'com.github.johnrengelman.shadow' version '4.0.4'
    id "com.katalon.gradle-plugin" version "0.0.6"
}

ext {
    groovyVersion = '2.4.7'
}

configurations {
    generateDocs
}

repositories {
    jcenter()
    mavenCentral()
}
dependencies {
    generateDocs "org.codehaus.groovy:groovy-all:${groovyVersion}"
}
sourceSets {
    main {
        groovy {
            srcDirs = ['Keywords', 'Include/scripts/groovy']
            srcDir 'Libs'
        }
    }
}

katalon {
    dependencyPrefix = "com.katalon"
    minimize = false
}

task groovydoc(type: Groovydoc, overwrite:true) {
    source = sourceSets.main.groovy
    classpath = configurations.compile
    groovyClasspath = project.configurations.generateDocs
    include 'com/kazurayam/junit4ks/*'
    exclude '**/*Test.groovy'
}
task publishGroovydoc(type: Copy) {
    from 'build/docs/groovydoc'
    into 'docs/api'
}
groovydoc.finalizedBy publishGroovydoc

```

`task groovydoc` will generate HTML files into `build/docs/groovydoc`. However Github Pages required files to be located under the `docs` directory. Therefore I added `task publishGroovydoc` and `groovydoc.finalizedBy` statemenents to copy files from `build/docs/groovydoc` to `docs/api`.

`task groovydoc` required me to declare depencency to the groovy-all.jar. I specified the version 2.4.7 here, but I am not sure if it is appropriate.

* * *

I could find this trick (copying the groovydoc files from A to B on the task finalized) because I know Gradle better. I do not know how to implement this trick in Maven. This is why I prefer Gradle to Maven.

* * *

I used [Github Pages](https://pages.github.com/) to publish the groovydoc. I am wondering how Katalon Store is going to accomodate the API docs of plugins. Is Katalon Store going to provide “Github Pages” equivalent?

---

<div class="post-metadata">

**Author:** ![devalex88](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/devalex88/32/336_2.png) [@devalex88](https://forum.katalon.com/u/devalex88)\
**Post date:** [May 2, 2019, 5:08am UTC](https://forum.katalon.com/t/how-to-generate-groovydoc-of-plugin/21028/2 "2019-05-02T05:08:58Z")

</div>

Thank you @kazurayam. Is this the final version? Would you mind if I add its to the plugin docs?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 2, 2019, 7:53am UTC](https://forum.katalon.com/t/how-to-generate-groovydoc-of-plugin/21028/3 "2019-05-02T07:53:39Z")

</div>

I woud add a line:

```auto
defaultTasks groovydoc

```

I do not think it is a good idea to extend the “build.gradle” file to include codes for groovydoc. That makes the file quite messy. I would rather like to create another file “groovydoc.gradle” which is speciallized for groovy doc, and I would execute:

```auto
$ gradle -b groovydoc.gradle

```

---

<div class="post-metadata">

**Author:** ![devalex88](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/devalex88/32/336_2.png) [@devalex88](https://forum.katalon.com/u/devalex88)\
**Post date:** [May 2, 2019, 12:30pm UTC](https://forum.katalon.com/t/how-to-generate-groovydoc-of-plugin/21028/4 "2019-05-02T12:30:33Z")

</div>

Yes that makes sense.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 2, 2019, 2:08pm UTC](https://forum.katalon.com/t/how-to-generate-groovydoc-of-plugin/21028/5 "2019-05-02T14:08:36Z")

</div>

```auto
    id 'com.github.johnrengelman.shadow' version '4.0.4'
    id "com.katalon.gradle-plugin" version "0.0.6"

```

groovydoc.gradle would not require these 2 plugins.

---

<div class="post-metadata">

**Author:** ![albert.vu](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/albert.vu/32/20595_2.png) [@albert.vu](https://forum.katalon.com/u/albert.vu)\
**Post date:** [August 8, 2022, 7:49am UTC](https://forum.katalon.com/t/how-to-generate-groovydoc-of-plugin/21028/6 "2022-08-08T07:49:15Z")

</div>


