In order for cljdoc to show API documentation we need to analyse each project. This analysis can fail for a variety of reasons:
This document aims to outline some ways for the community to help fix those broken builds.
This document is a work in progress and may get out of date more quickly than others.
If you're having trouble diagnosing the issue, jump on Slack or open an issue and other folks can help out.
There are two ways to fix dependency issues:
project.clj
, build.boot
or deps.edn
file)Option 1) should always be done but just doing 1) won't fix the build for previous releases. This is where 2) comes in.
Let's assume a project my/project
has a namespace project.http
which is considered optional and requires clj-http.client
.
Now because that namespace is optional the author of my/project
did not include clj-http
in the projects dependencies. It is expected that users add this dependency themselves when using the project.http
namespace.
In this situation cljdoc will try to generate API documentation for project.http
(because it's a namespace included in the jar) but will fail because a required namespace (clj-http.client
) is missing.
To fix this in the original project a proper dependency on clj-http
should be added. If it should not be included by default you can add a :scope "provided"
qualifier which will exclude that dependency by default but still list it in the project's dependencies (.pom
file).
[clj-http "3.9.1" :scope "provided"]
Once a new release with this change is made the build should work (assuming no other issues). It's usually a good idea to test things locally. This is part 1) described above.
For already released versions we should still do part 2) in some capacity.
This is where deps.clj
comes in.
This namespace is generally intended to take care of any manual dependency adjustments.
In most cases a small adjustment to hardcoded-deps
is probably all that's needed but if you're uncertain, just open a PR and we can work it out together.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close