2

In my grails 1.3.7 project, I have put all of my classes in com.mycompany.myapp, as you do. So this goes for services, controllers, domain classes. I have a filter that goes in its own package. My app works fine.

However, when I run grails doc, grails decides to create two pages for every class:

  • one in its right comp.mycompany.myapp package that has all the right Groovy Doc
  • the other takes all the above classes and pretends as if those also live in the default package.

So, target/docs contains two directories: 'DefaultPackage' and 'com', with DefaultPackage holding a copy of everything that lives under com/

Consequently, my groovy doc looks messy because there is two copies for each class.

How can I solve this?

Hans Westerbeek
  • 5,645
  • 3
  • 34
  • 35

2 Answers2

1

It has been documented as a bug at GRAILS-6605. There is no workaround listed there for the bug.

schmolly159
  • 3,881
  • 17
  • 26
1

I too faced the same issue and so created a plugin "Grails Runtime Docs" ( http://grails.org/plugin/grails-runtime-docs ) that solves this issue and generates both Java and groovy docs properly only 1 copy per class. It's grails aware and categorizes the classes into Controllers, Commands, Domains, Services and Tag Libraries. The groovy documentation is actually generated from runtime so as to include the dynamic methods also, adding "Dynamic Method Summary" & "Dynamic Method Detail" in the generated html docs, that provide their source information. Hope you find it useful.

Srinath Anantha
  • 108
  • 1
  • 7
  • The plugin doesn't work with grails 2.2.0, there are two issues with it. Getting error "java.lang.NullPointerException at com.imaginea.labs.grails.runtimedocs.GroovyRuntimeDocWriter.writePackages(GroovyRuntimeDocWriter.java:39) at RuntimeDocs$_run_closure4.doCall(RuntimeDocs:137)" – Mathias Conradt Feb 23 '13 at 13:15