Force intellij to download scala-library sources in an existing project

Another option to attach the sources, if Intellij is not downloading it automatically, is to download from the Scala page manually and attach in Intellij.

Example:

  • Go to https://www.scala-lang.org/download/2.13.1.html
  • Download the sources in the link (e.g. scala-sources-2.13.1.tar.gz)
  • Extract the zip file
  • In Intellij, click on the Attach Sources (as in the screenshot on the question)
  • Inform the path where the file was extracted

You can edit the sbt settings of an existing project:

enter image description here enter image description here

After selecting 'Download: Sources' and closing the settings, you must refresh the sbt project to trigger the download:

enter image description here