-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional dependencies are not picked up #47
Comments
Yes, that seems reasonable. I feel like I deliberately chose not to include optional dependencies, but I can't remember why... I can't think of a good reason not to include them. Do you want to make a PR? If so, please include a scripted test for it. https://github.com/cb372/sbt-explicit-dependencies/tree/master/src/sbt-test/basic/no-unused-no-undeclared-provided is probably a good test to use as a reference. |
Let me see what I can come up with! |
@DieBauer Thanks for the PR. I'll take a look at it now. Out of curiosity, why does your project have h2 as an optional dependency instead of a normal compile-time dependency? Is your project a library or an application? I'd like to understand more about your use case, because I haven't encountered many optional dependencies in the wild. Do you have some kind of conditional code, along the lines of if (h2isOnTheClasspath) {
useH2()
} ? |
That's exactly the use case. For me it is a spring-boot module/library, that has some classes with So instead of multiple artifacts for every 'flavour', it is one artifact with optional behaviour ;) |
I'm using this plugin to sanitize my dependencies, thanks for that!
But I'm now running into an issue that one module is using optional dependencies.
But this dependency now keeps on showing up in undeclared dependencies.
I see
sbt-explicit-dependencies/src/main/scala/explicitdeps/Logic.scala
Line 99 in b106c39
Can we also support optional?
The text was updated successfully, but these errors were encountered: