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

Option to exclude transitive ivy dependencies #214

Closed
raskam opened this issue Mar 9, 2018 · 1 comment
Closed

Option to exclude transitive ivy dependencies #214

raskam opened this issue Mar 9, 2018 · 1 comment

Comments

@raskam
Copy link

raskam commented Mar 9, 2018

Currently Dep only has an option to configure coursier attributes, but there's no way to configure coursier exclusions.

Right now I'm using implicits to achieve this:

  implicit class RichDep(dep: Dep) {
    def exclude(exclusions: (String, String)*): Dep = {
      dep match {
        case d: Dep.Java => d.copy(dep = d.dep.copy(exclusions = d.dep.exclusions ++ exclusions))
        case d: Dep.Scala => d.copy(dep = d.dep.copy(exclusions = d.dep.exclusions ++ exclusions))
        case d: Dep.Point => d.copy(dep = d.dep.copy(exclusions = d.dep.exclusions ++ exclusions))
      }
    }
  }

And usage:

ivy"org.quartz-scheduler:quartz:${V.quartzV}"
  .exclude(
    "com.mchange" -> "c3p0",
    "com.zaxxer" -> "HikariCP-java6"
  )

Better would be of course to modify the Dep directly. I could make it into PR if you like the way it is implemented.

@lihaoyi
Copy link
Member

lihaoyi commented Mar 10, 2018

@raskam you can always fall back to passing in a coursier.Dependency to ivyDeps; could you try configuring one with the exclusion you want and seeing if that works?

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