Generate and publish edoc in Jenkins using Javadoc plugin

edoc is Erlang’s answer to javadoc and can be easily added to an existing Jenkins  Erlang build job leveraging the Jenkins javadoc plugin to generate and display documentation.

Generate edoc

Generate edoc for a rebar enabled project by invoking the following command
./rebar doc skip_deps=true

This automatically creates creates a doc dir which will be populated with generated html files

Configure jenkins

Edit your existing Jenkins Erlang build job, configure as follows

  • Add in the additional rebar doc command (./rebar doc skip_deps=true)
  • Add post-build action of type ‘Publish Javadoc’
    Adding javadoc as a post build step
  • Configure the plugin to point at the contents of the generated doc dir
    Configure javadoc plugin to point at doc dir
  • Save settings and kick off job
  • After job finishes click on the new document link
    Click on newly created document link