{"id":18542163,"url":"https://github.com/heremaps/here-sbt-bom","last_synced_at":"2025-04-09T18:31:33.005Z","repository":{"id":193289624,"uuid":"666315687","full_name":"heremaps/here-sbt-bom","owner":"heremaps","description":"SBT BOM is the plugin for SBT for dealing with Maven BOM in SBT projects","archived":false,"fork":false,"pushed_at":"2025-01-07T12:18:34.000Z","size":78,"stargazers_count":25,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T10:21:16.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heremaps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-14T08:01:09.000Z","updated_at":"2025-03-12T10:09:55.000Z","dependencies_parsed_at":"2024-01-15T14:44:02.123Z","dependency_job_id":"47dda749-6214-4346-8d4e-22a9505c8a0a","html_url":"https://github.com/heremaps/here-sbt-bom","commit_stats":null,"previous_names":["heremaps/here-sbt-bom"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fhere-sbt-bom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fhere-sbt-bom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fhere-sbt-bom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heremaps%2Fhere-sbt-bom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heremaps","download_url":"https://codeload.github.com/heremaps/here-sbt-bom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248087753,"owners_count":21045584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T20:07:35.975Z","updated_at":"2025-04-09T18:31:27.997Z","avatar_url":"https://github.com/heremaps.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/heremaps/here-sbt-bom/actions/workflows/release.yml/badge.svg)](https://github.com/heremaps/here-sbt-bom/actions?query=workflow%3ARelease+branch%3Amaster)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.here.platform/root_2.12/badge.svg)](https://search.maven.org/artifact/com.here.platform/sbt-bom_2.12_1.0)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# HERE SBT BOM plugin\n\n## Introduction\nThe HERE platform SBT BOM plugin provides a way to use Maven [BOM (bill of materials)](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms) in SBT projects.\nThe plugin features importing multiple BOM files to use as a source of dependency versions, automatically processing parent and dependent BOMs.\n\n## Limitation\nThe HERE platform SBT BOM plugin is provided \"as is\" and is not officially a part of HERE Workspace or HERE Marketplace.\nWhile there is no official support by HERE, you may still raise issues via GitHub. We may be able to help.\n\n## Prerequisites\nThis plugin is compatible with:\n- sbt 1.3.0 or newer\n\n## How to use it\nThe following text provides a step-by-step guide on how to import [Jackson BOM](https://github.com/FasterXML/jackson-bom) into an sbt project.\n\n### Load the plugin\n\nAdd the `sbt-bom` plugin to `plugins.sbt` file.\n```scala\naddSbtPlugin(\"com.here.platform\" % \"sbt-bom\" % \"1.0.14\")\n```\n\n#### Add Maven central repository in your resolvers\n\nIf you're encountering issues or using earlier versions, you might have to explicitly declare the Maven Central repository:\n```scala\nresolvers += Resolver.url(\n  \"MAVEN_CENTRAL\",\n  url(\"https://repo.maven.apache.org/maven2\"))(\n  Patterns(\"[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]\") )\n```\nThis will enable the project to access plugin files stored in Maven Central, https://repo.maven.apache.org/maven2/com/here/platform/sbt-bom_2.12_1.0/.\n\n### Read \u0026 use a BOM\n\nThere are different ways to use the plugin depending on your use case.\n\n#### Use it in `dependencyOverrides`  (`Bom.dependencies`)\n\nIf you want to get all the dependencies declared in the BOM and use their version to override yours.\n\nUse the following setup in your `build.sbt`:\n```scala\nimport com.here.bom.Bom\n\n// Declare the BOM\n// Note the usage of Bom.dependencies method\nlazy val jacksonDependencies = Bom.dependencies(\"com.fasterxml.jackson\" % \"jackson-bom\" % \"2.14.2\")\n\nlazy val `demo` = project\n  .in(file(\".\"))\n  // Load the BOM\n  .settings(jacksonDependencies)\n  // Add all dependencies of the BOM in dependencyOverrides\n  .settings(\n    dependencyOverrides ++= jacksonDependencies.key.value\n  )\n```\n\n#### Use it in `dependencyOverrides` and `libraryDependencies` (`Bom.apply`)\n\nIf you want to:\n- get all the dependencies declared in the BOM and use their version to override yours,\n- also use the version of a BOM dependency explicitly\n\nUse the following setup in your `build.sbt`:\n```scala\nimport com.here.bom.Bom\n\n// Declare the BOM\n// Note the usage of Bom.apply method\nlazy val jacksonBom = Bom(\"com.fasterxml.jackson\" % \"jackson-bom\" % \"2.14.2\")\n\nlazy val `demo` = project\n  .in(file(\".\"))\n  // Load the BOM\n  .settings(jacksonBom)\n  // Add some explicit dependencies\n  .settings(\n    libraryDependencies += \"com.fasterxml.jackson.core\" % \"jackson-core\" % jacksonBom.key.value\n  )\n  // Add all dependencies of the BOM in dependencyOverrides\n  .settings(\n    dependencyOverrides ++= jacksonBom.key.value.bomDependencies\n  )\n```\n\n#### Custom usage (`Bom.read`)\n\nIn addition to the common usages described above, you can also use the BOM in a custom way thanks to `Bom.read`.\n\nExample, in your `build.sbt`:\n```scala\nimport com.here.bom.Bom\n\n// Declare the BOM and map it to a custom class\n// Note the usage of Bom.read method\nlazy val jacksonDependencies = Bom.read(\"com.fasterxml.jackson\" % \"jackson-bom\" % \"2.14.2\")(bom =\u003e Dependencies(bom))\n\nlazy val `demo` = project\n  .in(file(\".\"))\n  // Load the BOM\n  .settings(jacksonDependencies)\n  // Add some explicit dependencies\n  .settings(\n    libraryDependencies ++= jacksonDependencies.key.value.someDependencies\n  )\n  // Add all dependencies of the BOM in dependencyOverrides\n  .settings(\n    dependencyOverrides ++= jacksonDependencies.key.value.allDependencies\n  )\n```\n\nAnd in a `project/Dependencies.scala` file:\n```scala\nimport sbt._\nimport com.here.bom.Bom\n\ncase class Dependencies(bom: Bom) {\n  val someDependencies: Seq[ModuleID] = Seq(\n    \"com.fasterxml.jackson.core\" % \"jackson-core\" % bom\n  )\n  \n  val allDependencies: Seq[ModuleID] = bom.bomDependencies\n}\n```\n\n### Password-protected repositories\nThe following text explains how to access password-protected repositories, specifically the HERE platform repository,\nusing a file with credentials.\n\nFor accessing password-protected repositories, such as the HERE platform repository, you need to create a file with credentials at `~/.sbt/.credentials`\nwith the following content:\n```\nrealm=Artifactory Realm\nhost=repo.platform.here.com\nuser=\u003cyour used id\u003e\npassword=\u003ctop secret password\u003e\n```\nThe user name and password can be retrieved as described in the [Get your repository credentials tutorial](https://www.here.com/docs/bundle/here-workspace-developer-guide-java-scala/page/topics/get-credentials.html#get-your-repository-credentials).\n\nThen include the credentials in `build.sbt` file:\n```sbt\nproject.settings(\n  credentials += Credentials(Path.userHome / \".sbt\" / \".credentials\")\n)\n```\nand include the HERE platform repository resolver:\n```sbt\nThisBuild / resolvers += (\n  \"HERE Platform Repository\" at \"https://repo.platform.here.com/artifactory/open-location-platform\"\n)\n```\nNow the project is configured to use BOM files from a password-protected repository. For example, [`sdk-batch-bom`](https://www.here.com/docs/bundle/here-workspace-developer-guide-java-scala/page/sdk-libraries.html#sdk-libraries-for-batch-primary) can be used.\n```sbt\nlazy val sdkBom = Bom.read(\"com.here.platform\" %% \"sdk-batch-bom\" % \"2.57.3\")(bom =\u003e Dependencies(bom))\n```\n\nThe credentials can be supplied through these methods, with the following precedence:\n1. By passing the command line parameter `-Dsbt.boot.credentials=\u003cfile\u003e`.\n2. Via the environment variable `SBT_CREDENTIALS=\u003cfile\u003e`.\n3. By creating the file `~/.sbt/.credentials` in your home directory.\n4. By creating the file `~/.ivy2/.credentials` in your home directory.\n\n### Resolving issues\nIf your project packaging fails, you can examine the plugin debug logs using the following commands:\n```shell\nsbt package\nsbt last\n```\nThis sequence of commands will print all the logs generated during packaging to the console.\n\n## Contributors\n- Evgenii Kuznetcov (https://github.com/simpadjo)\n- Oleksandr Vyshniak (https://github.com/molekyla)\n- Andrii Banias (https://github.com/abanias)\n- Anton Wilhelm (https://github.com/devtonhere)\n- Dmitry Abramov (https://github.com/dmitriy-abramov)\n- Gaël Jourdan-Weil (https://github.com/gaeljw)\n\n## License\nCopyright (C) 2019-2024 HERE Europe B.V.\n\nUnless otherwise noted in `LICENSE` files for specific files or directories, the [LICENSE](LICENSE) in the root applies to all content in this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheremaps%2Fhere-sbt-bom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheremaps%2Fhere-sbt-bom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheremaps%2Fhere-sbt-bom/lists"}