Skip to content

pom should respect optional dependencies #14

Open
@mainej

Description

@mainej

My library has an optional dependency, that is, a dependency that is only needed when users need a specific part of the library. (Note that this is different from a "scope provided" dependency, which is always needed. Here is one explanation of the difference.) I would like to mark this dependency appropriately in my pom.xml, so that it isn't transitively included in my users' dependency trees unless they need it.

As of tools.deps.alpha 0.9.745 there is a way to specify this type of dependency. You add the dependency as a regular entry in :deps, with an additional :optional true flag. Then, when you run clojure -Spom, the dependency is marked as <optional>true</optional> in the pom. However, deps-library depends on garamond 0.4.0, which in turn depends on tools.deps.alpha 0.5.460. Therefore deps-library doesn't add the optional tag, and in fact strips it out if it already exists.

So, I'd like to request that you coordinate with garamond to update to a more recent version of tools.deps.alpha. It looks like a bump of tools.deps.alpha has already been committed, but that commit hasn't been released. I'll reach out to garamond as well to request that they release a new version of their library.

Thanks for your work making deps.edn libraries work with Clojars—it's a really fiddly business.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions