sbt / sbt-license-report

Report on licenses used in an sbt project.
86 stars 31 forks source link

Support dependency resolution using coursier #47

Open onmomo opened 3 years ago

onmomo commented 3 years ago

Currently, the plugin resolves the dependencies using ivy resolver. Our builds only work with coursier, therefore we noticed sbt failing to resolve the dependencies.

The plugin seems not maintained anymore. Any pointers on how the plugin could be improved to respect the actual sbt dependency resolution configuration?

steinybot commented 3 years ago

I wonder how much this could speed things up by. It just took 3:32 to run on my relatively simple project with only ~25 dependencies in total (albeit IntelliJ is showing WAY more than that). Perhaps there is something else going on.

eed3si9n commented 3 years ago
  1. updateFull returns UpdateReport - https://github.com/sbt/librarymanagement/blob/v1.4.3/core/src/main/contraband-scala/sbt/librarymanagement/UpdateReport.scala
  2. UpdateReport contains ConfigurationReport for each configurations - https://github.com/sbt/librarymanagement/blob/v1.4.3/core/src/main/contraband-scala/sbt/librarymanagement/ConfigurationReport.scala
  3. ConfigurationReport details contains OrganizationArtifactReport, for all transitive dependencies, which contains ModuleReport - https://github.com/sbt/librarymanagement/blob/v1.4.3/core/src/main/contraband-scala/sbt/librarymanagement/ModuleReport.scala
  4. ModuleReport contains the license information
xuwei-k commented 5 months ago
mdedetrich commented 5 months ago

I would love for this to be implemented, doing the changes to make this work is actually quite trivial as a result of https://github.com/sbt/sbt-license-report/pull/86 however as has been posted previously, its currently blocked by https://github.com/coursier/coursier/issues/1790.

xuwei-k commented 2 days ago

https://gist.github.com/xuwei-k/5ea6e1cb00c425d754b3be54d93e960c 🤔

mdedetrich commented 2 days ago

https://gist.github.com/xuwei-k/5ea6e1cb00c425d754b3be54d93e960c 🤔

This seems to also use the default resolution mechism in SBT which is Coursier.

If so you will hit the same problem mentioned before, coursier cannot get the licenses from all types of dependencies (see https://github.com/coursier/coursier/issues/1790)

xuwei-k commented 2 days ago

coursier cannot get the licenses

Yes, so I have parse pom.xml manually

mdedetrich commented 2 days ago

coursier cannot get the licenses

Yes, so I have parse pom.xml manually

Ah yes I see now. We can do this as a workaround but if you have figured out how to get the proper/full license info maybe it makes sense to fix it in upstream coursier?