{"id":15134873,"url":"https://github.com/jetbrains/sbt-idea-plugin","last_synced_at":"2025-04-05T04:09:40.367Z","repository":{"id":37484421,"uuid":"71482889","full_name":"JetBrains/sbt-idea-plugin","owner":"JetBrains","description":"Develop IntelliJ plugins with Scala and SBT","archived":false,"fork":false,"pushed_at":"2025-03-10T16:32:48.000Z","size":14373,"stargazers_count":103,"open_issues_count":18,"forks_count":29,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-03-29T03:07:22.887Z","etag":null,"topics":["intellij","intellij-ide","intellij-platform","intellij-plugin","plugin-sbt","sbt","sbt-plugin"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JetBrains.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2016-10-20T16:33:36.000Z","updated_at":"2025-03-25T07:57:38.000Z","dependencies_parsed_at":"2024-05-16T20:47:16.068Z","dependency_job_id":"382fb023-561e-4010-9a9b-040c8ad15ca5","html_url":"https://github.com/JetBrains/sbt-idea-plugin","commit_stats":null,"previous_names":[],"tags_count":166,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fsbt-idea-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fsbt-idea-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fsbt-idea-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fsbt-idea-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JetBrains","download_url":"https://codeload.github.com/JetBrains/sbt-idea-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246131308,"owners_count":20728302,"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":["intellij","intellij-ide","intellij-platform","intellij-plugin","plugin-sbt","sbt","sbt-plugin"],"created_at":"2024-09-26T05:40:24.889Z","updated_at":"2025-03-29T03:07:36.264Z","avatar_url":"https://github.com/JetBrains.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sbt-idea-plugin\n\n[![Version](https://index.scala-lang.org/jetbrains/sbt-idea-plugin/sbt-idea-plugin/latest.svg)](https://index.scala-lang.org/jetbrains/sbt-idea-plugin/sbt-idea-plugin)\n![Build Status](https://github.com/jetbrains/sbt-idea-plugin/actions/workflows/scala.yml/badge.svg)\n[![JetBrains team project](http://jb.gg/badges/team.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)\n[![Discord](https://badgen.net/badge/icon/discord?icon=discord\u0026label)](https://discord.gg/aUKpZzeHCK)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/JetBrains/intellij-scala)\n\nSBT plugin that makes development of IntelliJ Platform plugins in Scala easier by providing features such as:\n\n- Downloading and attaching IntelliJ Platform binaries\n- Setting up the environment for running tests\n- Flexible way to define plugin artifact structure\n- Publishing the plugin to JetBrains plugin repository\n\nFor a comprehensive usage example see [Scala plugin](https://github.com/JetBrains/intellij-scala) or \n[HOCON plugin](https://github.com/JetBrains/intellij-hocon/) build definition.\n\nA complete list of public IJ plugins implemented in Scala/SBT can be found on [IntelliJ Platform Explorer](https://plugins.jetbrains.com/intellij-platform-explorer/?buildSystem=sbt)\n\nNote that some features of this plugin may be used independently, i.e. if you only want to [print project structure](#printprojectgraph--taskkeyunit)\nor [package artifacts](#packaging) you can depend on:\n\n`\"org.jetbrains\" % \"sbt-declarative-visualizer\" % \"LATEST_VERSION\"` or\n\n`\"org.jetbrains\" % \"sbt-declarative-packaging\" % \"LATEST_VERSION\"`\n\nPlease see the [Known Issues](#known-issues-and-limitations) section if you come across a problem, and feel free\nfile a bug on the [Issues](https://github.com/JetBrains/sbt-idea-plugin/issues) page of this repo if you find one.\n\n## Quickstart: IJ Plugin Template Project\n\nTo quickly create a Scala based IJ Plugin we provide a template project. Create your own repo on GitHub from the [ JetBrains / **sbt-idea-example** ](https://github.com/JetBrains/sbt-idea-example) template by clicking the green `Use this template` button.\n   Clone the sources and open the `build.sbt` via `File | Open` menu in IDEA by choosing `Open as a project`.\n\n## Manual Installation (adding to an already existing sbt build)\n\nFrom version 1.0.0, this plugin is published for sbt 0.13 and 1.0.\nFrom version 3.17.0, this plugin is published for sbt 1.0 only.\n\n* Insert into `project/plugins.sbt`:\n\n```Scala\naddSbtPlugin(\"org.jetbrains\" % \"sbt-idea-plugin\" % \"LATEST_VERSION\")\n```\n\n* [Enable](#auto-enable-the-plugin) the plugin for your desired projects (your main plugin project and all its dependencies)\n\n* Run SBT and the plugin will automatically download and attach IntelliJ Platform dependencies.\n\n* Start coding\n\n## SBT Related Settings and Tasks\n\n### IntelliJ Platform and Plugin\n\n#### `intellijPluginName in ThisBuild :: SettingKey[String]`\n\n**Default**: `name.in(LocalRootProject).value`\n\nName of your plugin. Better set this beforehand since several other settings such as\nIntelliJ Platform directories and artifact names depend on it. Please see [name troubleshooting](#name-key-in-projects)\nfor more info.\n\n#### `intellijBuild in ThisBuild :: SettingKey[String]`\n\n**Default**: `LATEST-EAP-SNAPSHOT`\n\nSelected IDE's build number. Binaries and sources of this build will be downloaded from the\n[repository](https://www.jetbrains.org/intellij/sdk/docs/reference_guide/intellij_artifacts.html) and used in \ncompilation and testing. You can find build number of your IntelliJ product in `Help -\u003e About` dialog. However, it might be \nincomplete, so it is strongly recommended to verify it against \n[available releases](https://www.jetbrains.com/intellij-repository/releases) and\n[available snapshots](https://www.jetbrains.com/intellij-repository/snapshots).\n\n**Note**: minimum supported major IDEA version: `242.x` (~`2024.2.x`)\n\n#### `intellijPlatform in ThisBuild :: SettingKey[IntelliJPlatform]`\n\n**Default**: `IntelliJPlatform.IdeaCommunity`\n\nEdition of IntelliJ IDE to use in project. Currently available options are:\n\n- IdeaCommunity\n- IdeaUltimate\n- PyCharmCommunity\n- PyCharmProfessional\n- CLion\n- MPS\n\n#### `intellijPlugins :: SettingKey[IdeaPlugin]`\n\n**Default**: `Seq.empty`\n\nIntelliJ plugins to depend on. Bundled(internal) plugins are specified by their plugin ID.\nPlugins from repo can be specified by the plugin's id, optional version and update channel.\nPlugins will be checked for compatibility against the `intellijBuild` you specified and updated to the latest version unless\n some specific version is given explicitly. Inter-plugin dependencies are also transitively resolved(e.g. depending\n on the Scala plugin will automatically attach Java and other plugin dependencies)\n \n Plugin IDs can be either searched by plugin name with the help of [searchPluginId](#searchpluginid--mapstring-string-boolean)\n task or [manually](https://github.com/JetBrains/sbt-idea-plugin/wiki/How-to-find-plugin's-id)\n \n You can tune plugin resolving on individual plugin level by specifying several options to `toPlugin` method:\n - `transitive`   - use transitive plugin resolution(default: true)\n - `optionalDeps` - resolve optional plugin dependencies(default: true)\n - `excludedIds`  - blacklist certain plugins from transitive resolution(default: Set.empty)\n \n :exclamation: Please note that Java support in IJ is implemented by a plugin: `com.intellij.java`\n \n :exclamation: Please remember that you must [declare plugin dependencies in plugin.xml](https://jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html#dependency-declaration-in-pluginxml) or your plugin may fail to load.\n\n```SBT\n// use properties plugin bundled with IDEA\nintellijPlugins += \"com.intellij.properties\".toPlugin\n// use Scala plugin as a dependency\nintellijPlugins += \"org.intellij.scala\".toPlugin\n// use Scala plugin version 2023.3.10\nintellijPlugins += \"org.intellij.scala:2023.3.10\".toPlugin\n// use latest nightly build from the repo\nintellijPlugins += \"org.intellij.scala::Nightly\".toPlugin\n// use specific version from Eap update channel\nintellijPlugins += \"org.intellij.scala:2023.3.10:Eap\".toPlugin\n// add JavaScript plugin but without its Grazie plugin dependency\nintellijPlugins += \"JavaScript\".toPlugin(excludedIds = Set(\"tanvd.grazi\"))\n// add custom plugin with id `org.custom.plugin`, download it using the direct link https://org.example/path/to/your/plugin.zip\nintellijPlugins += \"org.custom.plugin:https://org.example/path/to/your/plugin.zip\".toPlugin\n// add custom plugin with id `org.custom.plugin` and resolve it from Marketplace.\n//  if it fails to resolve it in Marketplace it will use the fallback download link\nintellijPlugins += \"org.custom.plugin\".toPlugin.withFallbackDownloadUrl(\"https://org.example/path/to/your/plugin.zip\")\n```\n\n#### `intellijRuntimePlugins :: SettingKey[IdeaPlugin]`\n\n**Default**: `Seq.empty`\n\nIntelliJ plugins to load at runtime (includes tests). These plugins are not a compile time dependencies and cannot be\nreferenced in code. Useful for testing your plugin in the presence of other plugins.\n\nThe usage is the same as `intellijPlugins`.\n\n#### `searchPluginId :: Map[String, (String, Boolean)]`\n\nUsage: `searchPluginId [--nobundled|--noremote] \u003cplugin name regexp\u003e`\n\nSearches and prints plugins across locally installed IJ sdk and plugin marketplace.\nUse provided flags to limit search scope to only bundled or marketplace plugins.\n\n```\n\u003e searchPluginId Prop\n[info] bundled          - Properties[com.intellij.properties]\n[info] bundled          - Resource Bundle Editor[com.intellij.properties.bundle.editor]\n```\n\n#### `jbrInfo :: Option[JbrInfo]`\n\n**Default**: `AutoJbr()`\n\nJetBrains Java runtime version to use when running the IDE with the plugin. By default JBR version is extracted from\nIDE installation metadata. Only jbr 11 is supported. Available versions can be found on [jbr bintray](https://github.com/JetBrains/JetBrainsRuntime/releases).\nTo disable, set to `NoJbr`\n\n#### `patchPluginXml :: SettingKey[pluginXmlOptions]`\n\n**Default**: `pluginXmlOptions.DISABLED`\n\nDefine some [`plugin.xml`](https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_configuration_file.html)\nfields to be patched when building the artifact. Only the file in `target` folder\nis patched, original sources are left intact. Available options are:\n\n```SBT\npatchPluginXml := pluginXmlOptions { xml =\u003e\n  xml.version           = version.value\n  xml.pluginDescription = \"My cool IDEA plugin\"\n  xml.changeNotes       = sys.env(\"CHANGE_LOG_FROM_CI\")\n  xml.sinceBuild        = (intellijBuild in ThisBuild).value\n  xml.untilBuild        = \"193.*\"\n}\n```\n\n#### `intellijVMOptions :: SettingKey[IntellijVMOptions]`\n\nFine tune java VM options for running the plugin with [runIDE](#runide-nodebug-suspend-blocking--inputkeyunit) task.\nExample:\n\n```SBT\nintellijVMOptions := intellijVMOptions.value.copy(xmx = 2048, xms = 256) \n```\n\n#### `ideaConfigOptions :: SettingKey[IdeaConfigBuildingOptions]`\n\nFine tune how IntelliJ run configurations are generated when importing the project in IDEA.\n\n#### `runIDE [noDebug] [suspend] [blocking] :: InputKey[Unit]`\n\nRuns IntelliJ IDE with current plugin. This task is non-blocking by default, so you can continue using SBT console.\n\nBy default, IDE is run with non-suspending debug agent on port `5005`. This can be overridden by either optional\narguments above, or by modifying default [`intellijVMOptions`](#intellijvmoptions--settingkeyintellijvmoptions).\n\n### Publishing and Verification\n\n#### `publishPlugin [channel] :: InputKey[String]`\n\nUpload and publish your IntelliJ plugin on https://plugins.jetbrains.com.\nIn order to publish to the repo you need to \n[obtain permanent token](http://www.jetbrains.org/intellij/sdk/docs/plugin_repository/api/plugin_upload.html) and\neither place it into `~/.ij-plugin-repo-token` file or pass via `IJ_PLUGIN_REPO_TOKEN` env or java property.\n\nThis task also expects an optional argument - a [custom release channel](http://www.jetbrains.org/intellij/sdk/docs/plugin_repository/custom_channels.html).\nIf omitted, plugin will be published to the default plugin repository channel (Stable) \n \n\n#### `runPluginVerifier :: TaskKey[File]`\n\n[IntelliJ Plugin Verifier](https://github.com/JetBrains/intellij-plugin-verifier) integration task allows to \ncheck the binary compatibility of the built plugin against the currently used or explicitly specified \nIntelliJ IDE builds. The task returns a folder with the verification reports.\n\nThe verification can be customized by changing the default options defined in the `pluginVerifierOptions` key.\n```SBT\npluginVerifierOptions := pluginVerifierOptions.value.copy(\n  version = \"1.254\",        // use a specific verifier version\n  offline = true,           // forbid the verifier from reaching the internet\n  overrideIDEs  = Seq(\"IC-2019.3.5\", \"PS-2019.3.2\"), // verify against specific products instead of 'intellijBuild'\n  failureLevels = Set(FailureLevel.DEPRECATED_API_USAGES) // only fail if deprecated APIs are used\n   // ...\n)\n```\n\n#### `signPlugin :: TaskKey[File]`\n\nUtility task that signs the plugin artifact before uploading to the [JetBrains Marketplace](https://plugins.jetbrains.com/marketplace).\nSigning is performed using the [Marketplace zip signer](https://github.com/JetBrains/marketplace-zip-signer)\nlibrary. To sign a plugin a valid certificate chain, and a private key are required.\n\nSigning is disabled by default at the moment. To enable it and set the options, modify the `signPluginOptions` key:\n```SBT\nsignPluginOptions := signPluginOptions.value.copy(\n  enabled = true,\n  certFile = Some(file(\"/path/to/certificate\")), // or via PLUGIN_SIGN_KEY env var\n  privateKeyFile  = Some(file(\"/path/to/privateKey\")), // or via PLUGIN_SIGN_CERT env var\n  keyPassphrase = Some(\"keyPassword\") // or None if password is not set(or via PLUGIN_SIGN_KEY_PWD env var)\n)\n```\n\nIf signing the plugin artifact zip is enabled via `signPluginOptions`, this task will be used a dependency of the\n[`publishPlugin`](#publishplugin-channel--inputkeystring) task, so that the artifact is automatically signed before \nuploading to the [JetBrains Marketplace](https://plugins.jetbrains.com/marketplace)\n\n#### `buildIntellijOptionsIndex :: TaskKey[Unit]`\n\nBuilds index of options provided by the plugin to make them searchable via \n[search everywhere](https://www.jetbrains.com/help/idea/searching-everywhere.html#search_settings) action.\nThis task should either be manually called instead of `packageArtifact` or before `packageArtifactZip` since it patches \njars already built by `packageArtifact`.\n\n### Packaging\n\n#### `packageMethod :: SettingKey[PackagingMethod]`\n\n**Default for root project**: `PackagingMethod.Standalone(targetPath = s\"lib/${name.value}.jar\")`\n\n**Default for all other subprojects**: `PackagingMethod.MergeIntoParent()`\n\nControls how current project will be treated when packaging the plugin artifact.\n```SBT\n// produce standalone jar with the same name as the project:\npackageMethod := PackagingMethod.Standalone()\n\n// put all classes of this project into parent's jar\n// NB: this option supports transitive dependencies on projects: it will walk up the dependency \n// tree to find the first Standalone() project, however if your project has multiple such parents\n// this will result in an error - in this case use MergeIntoOther(project: Project) to expicitly\n// specify in which project to merge into\npackageMethod := PackagingMethod.MergeIntoParent()\n\n// This packages all projects that are marked with the same moduleName into\n// a module jar under lib/modules/\u003cmoduleName\u003e.jar\n// Modules are a new mechanism in intellij to better configure dependencies\n// between plugins and builtin modules.\npackageMethod := PackagingMethod.PluginModule(\"moduleName\")\n\n// merge all dependencies of this project in a standalone jar\n// being used together with assembleLibraries setting allows sbt-assembly like packaging\n// the project may contain classes but they will be ignored during packaging\npackageMethod := PackagingMethod.DepsOnly(\"lib/myProjectDeps.jar\")\nassembleLibraries := true\n\n// skip project alltogether during packaging\npackageMethod := PackagingMethod.Skip()\n```\n\n#### `packageLibraryMappings :: SettingKey[Seq[(ModuleID, Option[String])]]`\n\n**Default for root project**: `Seq.empty`\n\n**Default for all other project**s:\n```SBT\n\"org.scala-lang\"  % \"scala-.*\" % \".*\"        -\u003e None ::\n\"org.scala-lang.modules\" % \"scala-.*\" % \".*\" -\u003e None :: Nil\n```\n\nSequence of rules to fine-tune how the library dependencies are packaged. By default all dependencies\nincluding transitive are placed in the subfolder defined by \n[`packageLibraryBaseDir`](#packagelibrarybasedir--settingkeyfile)(defaults to \"lib\") of the plugin artifact.\n\nYou can use the [`findLibraryMapping`](#findlibrarymapping--inputkeyseqstring-seqmodulekey-optionstring)\ntask to debug the library mappings\n\n```SBT\n// merge all scalameta jars into a single jar\npackageLibraryMappings += \"org.scalameta\" %% \".*\" % \".*\" -\u003e Some(\"lib/scalameta.jar\")\n\n// skip packaging protobuf\npackageLibraryMappings += \"com.google.protobuf\" % \"protobuf-java\" % \".*\" -\u003e None\n\n// rename scala library(strip version suffix)\npackageLibraryMappings += \"org.scala-lang\" % \"scala-library\" % scalaVersion -\u003e Some(\"lib/scala-library.jar\")\n```\n\n#### `packageLibraryBaseDir :: SettingKey[File]`\n\n**Default**: `file(\"lib\")`\n\nSets the per-project default sub-folder into which external libraries are packaged. Rules from [`packageLibraryMappings`](#packagefilemappings--taskkeyseqfile-string)\nwill override this setting. \n\n**NB!**: This directory must be relative to the [`packageOutputDir`](#packageoutputdir--settingkeyfile) so don't prepend\nvalues of the keys with absolute paths (such as `target` or `baseDirectory`) to it\n\n**NB!**: IDEA plugin classloader **only** adds the `lib` folder to the classpath when loading your plugin. Modifying \nthis setting will essentially exclude the libraries of a project from automatic classloading\n\n```SBT\npackageLibraryBaseDir  := file(\"lib\") / \"third-party\"\n\n// protobuf will still be packaged into lib/protobuf.jar\npackageLibraryMappings += \"com.google.protobuf\" % \"protobuf-java\" % \".*\" -\u003e Some(\"lib/protobuf.jar\")\n```\n\n#### `packageFileMappings :: TaskKey[Seq[(File, String)]]`\n\n**Default**: `Seq.empty`\n\nDefines mappings for adding custom files to the artifact or even override files inside jars.\nTarget path is considered to be relative to `packageOutputDir`.\n\n```SBT\n// copy whole folder recursively to artifact root\npackageFileMappings += target.value / \"repo\" -\u003e \"repo/\"\n\n// package single file info a jar\npackageFileMappings += \"resources\" / \"ILoopWrapperImpl.scala\" -\u003e\n                            \"lib/jps/repl-interface-sources.jar\"\n                            \n// overwrite some file inside already existing jar of the artifact\npackageFileMappings +=  \"resources\" / \"META-INF\" / \"plugin.xml\" -\u003e\n                            \"lib/scalaUltimate.jar!/META-INF/plugin.xml\"                            \n``` \n\n#### `packageAdditionalProjects :: SettingKey[Seq[Project]]`\n\n**Default**: `Seq.empty`\n\nBy default the plugin builds artifact structure based on internal classpath dependencies\nof the projects in an SBT build(`dependsOn(...)`). However, sometimes one may need to package\na project that no other depends upon. This setting is used to explicitly tell the plugin which \nprojects to package into the artifact without a need to introduce unwanted classpath dependency.\n\n#### `shadePatterns :: SettingKey[Seq[ShadePattern]]`\n\n**Default**: `Seq.empty`\n\nClass shading patterns to be applied by JarJar library. Used to resolve name clashes with \nlibraries from IntelliJ platform such as protobuf.\n\n```SBT\nshadePatterns += ShadePattern(\"com.google.protobuf.**\", \"zinc.protobuf.@1\")\n```\n\n#### `bundleScalaLibrary in ThisBuild :: SettingKey[Boolean]`\n\nTrying to load the same classes in your plugin's classloader which have already been loaded by a parent classloader\nwill result in classloader constraint violation. A vivid example of this scenario is depending on some other plugin,\nthat bundles scala-library.jar(e.g. Scala plugin for IJ) and still bundling your own.\n\nTo workaround this issue `sbt-idea-plugin` tries to automatically detect if your plugin project has dependencies on \nother plugins with Scala and filter out scala-library.jar from the resulting artifact. However, the heuristic cannot\ncover all possible cases and thereby this setting is exposed to allow manual control over bundling the scala-library.jar  \n\n#### `instrumentThreadingAnnotations :: SettingKey[Boolean]`\n\n**Default**: `false`\n\nGenerate JVM bytecode to assert that a method is called on the correct IDEA thread. The supported annotations are:\n1. `com.intellij.util.concurrency.annotations.RequiresBackgroundThread`\n2. `com.intellij.util.concurrency.annotations.RequiresEdt`\n3. `com.intellij.util.concurrency.annotations.RequiresReadLock`\n4. `com.intellij.util.concurrency.annotations.RequiresReadLockAbsence`\n5. `com.intellij.util.concurrency.annotations.RequiresWriteLock`\n\nSee: [IntelliJ IDEA ThreadingAssertions.java](https://github.com/JetBrains/intellij-community/blob/5758eb99b4a1971ebe75cda755693cc930949465/platform/core-api/src/com/intellij/util/concurrency/ThreadingAssertions.java)\n\n#### `packageOutputDir :: SettingKey[File]`\n\n**Default**: `target.value / \"plugin\" / intellijPluginName.in(ThisBuild).value.removeSpaces`\n\nFolder to place the assembled artifact into.\n\n#### `packageArtifact :: TaskKey[File]`\n\nBuilds unpacked plugin distribution. This task traverses dependency graph of the\nbuild and uses settings described in the section above to create sub-artifact structure \nfor each project. By default all child projects' classes are merged into the root project jar,\nwhich is placed into the \"lib\" folder of the plugin artifact, all library dependencies\nincluding transitive are placed in the \"lib\" folder as well. \n \n \n#### `packageArtifactZip :: TaskKey[File]`\n\nProduces ZIP file from the artifact produced by `packageArtifact` task.\nThis is later used by `publishPlugin` as an artifact to upload.\n\n### Utils\n\n#### `findLibraryMapping :: InputKey[Seq[(String, Seq[(ModuleKey, Option[String])])]]`\n\nReturns detailed info about libraries and their mappings by a library substring.\nHelps to answer questions such as \"Why is this jar in the artifact?\" or \"Which module introduced this jar?\"\nExample:\n```\nsbt:scalaUltimate\u003e show findMapping interface\n[info] * (runtimeDependencies,ArrayBuffer((org.scala-sbt:compiler-interface:1.4.0-M12[],Some(lib/jps/compiler-interface.jar)), (org.scala-sbt:util-interface:1.3.0[],Some(lib/jps/sbt-interface.jar))))\n[info] * (repackagedZinc,ArrayBuffer((org.scala-sbt:compiler-interface:1.4.0-M12[],Some(*)), (org.scala-sbt:launcher-interface:1.1.3[],Some(*)), (org.scala-sbt:util-interface:1.3.0[],Some(*))))\n[info] * (compiler-jps,ArrayBuffer((org.scala-sbt:util-interface:1.3.0[],Some(*)), (org.scala-sbt:compiler-interface:1.4.0-M12[],Some(lib/jps/compiler-interface.jar))))\n[info] * (compiler-shared,ArrayBuffer((org.scala-sbt:util-interface:1.3.0[],Some(*)), (org.scala-sbt:compiler-interface:1.4.0-M12[],Some(*))))\n```\n\n#### `printProjectGraph :: TaskKey[Unit]`\n\nPrints ASCII graph of currently selected project to console. Useful for debugging complex builds.\n![](https://user-images.githubusercontent.com/1345782/65074597-d8172880-d99d-11e9-947e-aa74855e9ff1.png)\n\n## Running the plugin\n\n### From SBT\n\nTo run the plugin from SBT simply use [runIDE](#runide-nodebug-suspend-blocking--inputkeyunit) task.\nYour plugin will be automatically compiled, an artifact built and attached to new IntelliJ instance.\n\nDebugger can later be attached to the process remotely - the default port is 5005.\n\n### From IDEA\n\n- `sbt-idea-plugin` generates IDEA-readable artifact xml and run configuration on project import\n- After artifact and run configuration have been created(they're located in `.idea` folder of the project) you can \nrun or debug the new run configuration. This will compile the project, build the artifact and attach it to the\n new IDEA instance\n- :exclamation: Note that doing an \"SBT Refresh\" is required after making changes to your build\nthat affect the final artifact(i.e. changing `libraryDependencies`), in order to update IDEA configs\n- :exclamation: You may need to [manually build the artifact](#plugin-artifact-not-built-when-running-from-idea-after-importing-the-project)\n  when running your plugin for the first time\n  \n## Custom IntelliJ artifacts repo\n\nUnder some circumstances using a proxy may be required to access IntelliJ artifacts repo, or there even is a local\nartifact mirror set up. To use non-default repository for downloading IntelliJ product distributions set \n`sbtidea.ijrepo` jvm property. Example: `-Dsbtidea.ijrepo=https://proxy.mycompany.com/intellij-repository`\n  \n## Auto enable the plugin\n\nSbt-idea-plugin currently breaks scalaJS compilation, and thereby has autoloading disabled.\nTo enable it either add `enablePlugins(SbtIdeaPlugin)` to project definition. Example:\n```scala\nlazy val hocon = project.in(file(\".\")).settings(\n  scalaVersion  := \"2.12.8\",\n  version       := \"2019.1.2\",\n  intellijInternalPlugins := Seq(\"properties\"),\n  libraryDependencies += \"com.novocode\" % \"junit-interface\" % \"0.11\" % \"test\",\n).enablePlugins(SbtIdeaPlugin)\n```\n\nIf you with to automatically enable the plugin for all projects in your build, place the following class into top level \n`project` folder of your build.\n```scala\nimport org.jetbrains.sbtidea.AbstractSbtIdeaPlugin\n\nobject AutoSbtIdeaPlugin extends AbstractSbtIdeaPlugin {\n  override def trigger  = allRequirements\n}\n``` \n## Grouping with qualified names is available from Scala plugin version 2024.1.4\nIn the Scala plugin 2024.1.4 a significant change has been made according to modules grouping and their naming. You can read more about this change [here](https://youtrack.jetbrains.com/issue/SCL-21288/Rewrite-deprecated-module-grouping-logic-to-the-new-API-grouping-with-qualified-names-is-now-supported.#focus=Comments-27-8977291.0-0). \nBecause of this change, it was necessary to change how the project names are generated in packageMapping tasks (`packageMappings` and `packageMappingsOffline`).\nTo switch between the new and the old projects naming logic, `grouping.with.qualified.names.enabled` system property has been introduced.\nIf your Scala plugin version is 2024.1.4 or higher, then in order to generate correct mappings you should set this property to true (`-Dgrouping.with.qualified.names.enabled=true`). \nOtherwise, there is no need to do anything as this value is set to false by default.\n\n## Separate modules for production and test sources are available from Scala plugin version 2024.2.444\nFrom the 2024.2.444 Scala plugin version, the option to create separate modules for production and test sources has been introduced. You can read more about this change [here](https://youtrack.jetbrains.com/issue/SCL-21157/sbt-represent-production-and-test-sources-as-separate-IntelliJ-modules).\nBecause of this change, it was necessary to change how the project names (in `packageMappings` and `packageMappingsOffline` tasks) and module name (in `createIDEARunConfiguration` task) are generated.\nTo switch between separate modules for production and test sources and the \"old approach\" of module generation, `separate.prod.test.sources.enabled` system property has been introduced.\nIf your Scala plugin version is 2024.2.444 or higher, and you enabled separate modules for production and test sources in `Settings | Build, Execution, Deployment | Build Tools | sbt` \nthen to generate correct mappings and IDEA Run Configuration you should set this property to true (`-Dseparate.prod.test.sources.enabled=true`).\nOtherwise, there is no need to do anything as this value is set to false by default.\n\n## Known Issues and Limitations\n\n### `name` key in projects\n\nPlease do not explicitly set the `name` setting key for projects that have `SbtIdeaPlugin` attached.\nSBT will automatically set it from the `lazy val`'s name of the project definition.\n\nIDEA cannot correctly handle the sutuation when `name` key and `lazy val`'s name of a project are different,\nthus making the generated artifact and run configuration xml's invalid.\n\nRelated issue: https://github.com/JetBrains/sbt-idea-plugin/issues/72\n\n### Plugin artifact not built when running from IDEA after importing the project\n\nThe generated IDEA run configurations depend on the built artifact of the plugin, so it should be built \nautomatically when running or debugging the generated configuration.\n\nHowever, when the IDEA xml configuration file is created externally, like in the case of `sbt-idea-plugin`,\nit is sometimes not picked up immediately and requires an explicit loading.\n\nIt is recommended to explicitly invoke `Build | Build Artifacts | Rebuild` from IDEA after importing the project \nfor the first time(i.e. when xmls are first generated).\n\n### Development notes\nTo publish a new version of `sbt-idea-plugin`, just add a new tag in format `vA.B.C` (e.g.`v3.13.4`) and push it to the main branch.\nTeamCity will automatically  Build/Test/Deploy it in `sbt-idea-plugin` configuration. \\\n(works in internal network only)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetbrains%2Fsbt-idea-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjetbrains%2Fsbt-idea-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetbrains%2Fsbt-idea-plugin/lists"}