tomfaulhaber / lein-autodoc

A Leiningen plugin to generate Autodoc pages for your project
12 stars 4 forks source link

ClassNotFound when using lein-autodoc with bifocals #1

Open aperiodic opened 12 years ago

aperiodic commented 12 years ago

I'm trying to use autodoc to generate documentation for my bifocals project. First, a minor quibble: I had to put the lein-autodoc dependency in the :plugins key of my project.clj, not :dev-dependencies as the documentation suggests (I think this changed in lein 1.7.1).

The real problem, though, is that my namespaces will throw a ClassNotFoundException when loaded in the course of running lein-autodoc, which appears to prevent any documentation from being generated. The offending class is a java wrapper that the project uses. The part that I don't understand is that the compiled class is in the classes directory in the project's root, and that directory is in lein-autodoc's classpath (confirmed by changing lein-autodoc to have it print out its classpath; the very last entry is the classes directory). Am I goofing something up here?

aperiodic commented 12 years ago

I fooled around a little bit with running the autodoc command directly, using lein-autodoc's shell call as a starting point. I was able to get past the ClassNotFound exception by changing the --src option to be relative to the project root (the plugin was using an absolute one) and passing the fully qualified class name as the --load-classpath option. I also had to set the java.library.path to load the native components of one of the dependencies (is there a better way to do this?).

After all this, I was able to get autodoc to generate my documentation, but most of the functions in the project are missing from it. You can see the output (along with the command to recreate it, in comments in the project.cl) in the autodoc-woes branch of the project.

tomfaulhaber commented 12 years ago

Thanks for the issue report, Dan. I'll take a look and see if I can resolve it for you.