Skip to content

Instantly share code, notes, and snippets.

@vxhviet
Last active March 2, 2021 10:45
Show Gist options
  • Save vxhviet/cfd55bd1e8ab0d557573d98a055a1202 to your computer and use it in GitHub Desktop.
Save vxhviet/cfd55bd1e8ab0d557573d98a055a1202 to your computer and use it in GitHub Desktop.

How to add dependency to plain IntelliJ project

SOURCE

However in a plain IntelliJ project it's possible to get that library from Maven Central almost without hassle:

  • Open project structure
  • In the "Modules" page select a module which you use as a context of the scratch file (I suppose there will be just one module).
  • Switch to "Dependencies" tab and hit the plus button.
  • then in a context menu select "Library" -> "From Maven"
  • paste maven coordinates of the kotlinx.coroutines library artifact:
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3

where 1.3.3 is the version of that library. You can find the latest available version here: https://github.com/Kotlin/kotlinx.coroutines/blob/master/README.md

  • be sure to check "Transitive dependencies" and "Sources" boxes.

After hitting OK the library will be downloaded from Maven Central repository with all its dependencies and added to your module. Then it will be possible to use runBlocking in your project or scratch files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment