Fork me on GitHub

I've written a CLJC lib which has a namespace with test.check generators. I don't want to force a dependency on test.check, this namespace is sort-of optional. Of course, Cljdoc cannot analyze this namespace since test.check is missing. Is there a solution, a way of declaring an optional dep for Cljdoc?


I might be mistaken but I don't think this solves the problem. Here, if I want to use that namespace, I just have to add test.check to my deps. If I don't want to use it, I simply don't require. The problem is that Cljdoc has no way of knowing that it needs test.check for analyzing that namespace and producing doc. It throws because test.check is not found.


can you put the test.check dep in an alias and use that alias when generating cljdocs?


@localshred Yes that would be ideal but is it possible to specify an alias for Cljdoc? I didn't find anything in the doc, maybe an oversight


ah, that I'm not aware of... sorry 😞


hey @adam678! if you specify a :scope "test" or :scope "provided" for the dependency it will be included during analysis but not considered a dependency by regular consumers


It is a common pattern for Java pom.xml files to include optional dependencies this way


@martinklepsch Thanks Martin! I am not sure, does deps support adding a scope?! The generated pom file simply adds the dependency as a regular dep


I found that thread which mention this exact problem (in the context of Cljdoc) but no solution: