heremaps / here-sbt-bom

SBT BOM is the plugin for SBT for dealing with Maven BOM in SBT projects
Other
19 stars 6 forks source link

🐛 fix: use all resolvers to download BOM instead of only the added resolvers #15

Closed gaeljw closed 9 months ago

gaeljw commented 9 months ago

Aims to solve https://github.com/heremaps/here-sbt-bom/issues/7

Instead of only using resolvers (= the resolvers added explicitly added in the project), also add appResolvers in the list.

Example of difference behaviour between the two settings:

sbt:sbt-bom-example-github> show resolvers
[info] * my-company-in-project: https://artifactory.mycompany.net/artifactory/external

sbt:sbt-bom-example-github> show appResolvers
[info] Some(Vector(FileRepository(local, Patterns(ivyPatterns=Vector(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=Vector(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)([branch]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false, descriptorOptional=false, skipConsistencyCheck=false), FileConfiguration(true, None)), URLRepository(ivy-proxy-releases, Patterns(ivyPatterns=Vector(https://artifactory.mycompany.net/artifactory/ivy-remote-repos/[organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=Vector(https://artifactory.mycompany.net/artifactory/ivy-remote-repos/[organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false, descriptorOptional=false, skipConsistencyCheck=false), false), mycompany-releases-repo: https://artifactory.mycompany.net/artifactory/internal-releases, mycompany-snapshots-repo: https://artifactory.mycompany.net/artifactory/internal-snapshots, external: https://artifactory.mycompany.net/artifactory/external))

Because I have the following in my ~/.sbt/repositories file:

[repositories]
local

#### artifactory.mycompany.net
ivy-proxy-releases: https://artifactory.mycompany.net/artifactory/ivy-remote-repos/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
mycompany-releases-repo: https://artifactory.mycompany.net/artifactory/internal-releases
mycompany-snapshots-repo: https://artifactory.mycompany.net/artifactory/internal-snapshots
external: https://artifactory.mycompany.net/artifactory/external
gaeljw commented 9 months ago

I've been able to confirm this fixes the issue by "simulating" the change in my reproduction project, that is by doing:

ThisBuild / resolvers := appResolvers.value.getOrElse(Seq.empty) ++ resolvers.value
gaeljw commented 9 months ago

@molekyla I hope you don't mind that I tag you explicitly but would appreciate your feedback on this :)

molekyla commented 9 months ago

@gaeljw No worries. You can tag me explicitly. That is how we expect to receive PRs