Skip to content
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

unusedCompileDependencies doesn't play well with grouped dependencies #40

Open
JD557 opened this issue Sep 19, 2019 · 1 comment
Open

Comments

@JD557
Copy link

JD557 commented Sep 19, 2019

I have a project using pureconfig via "com.github.pureconfig" %% "pureconfig" % "0.12.0"

If you look at the build.sbt, you'll notice that this artifact simply bundles pureconfig-core and pureconfig-generic.

Due to this, running undeclaredCompileDependencies always returns pureconfig-core/pureconfig-generic and running unusedCompileDependencies always returns pureconfig.

Unfortunately, this means that simply running unusedCompileDependencies can point to dependencies that are actually being used, so it can't be safely used without fixing the undeclaredCompileDependencies first.

Is this the expected behavior?

@cb372
Copy link
Owner

cb372 commented Sep 26, 2019

Hi! Sorry for the slow response.

I'm afraid this is the expected behaviour. Technically you are declaring a dependency on one artifact (pureconfig) but your code is actually depending on its transitive dependencies.

You have two options to work around this:

  • Change your libraryDependencies to depend directly on pureconfig-core and pureconfig-generic. This is not a great option - you shouldn't have to change your build config just to satisfy the plugin
  • Add filters to tell the plugin to ignore pureconfig (see the README

It would be nice to handle cases like this automatically, but I can't think of a reliable heuristic we could use to detect it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants