Why can't IntelliJ find SBT snapshot dependencies?

I have a Play 2.3 Scala project that works great when launched using the activator launch command. However, if I try to run it in IntelliJ 13 from the Run / Debug configuration option, there is a problem with resolving snapshot dependencies.

According to the logs, the following repositories were checked for dependency checking:

[warn] module not found: org.package#my-dep;1.0-SNAPSHOT [warn] ==== local: tried [warn] C:\Users\MyUser\.ivy2\local\org.package\my-dep\1.0-SNAPSHOT\ivys\ivy.xml [warn] ==== public: tried [warn] http://repo1.maven.org/maven2/org/package/my-dep/1.0-SNAPSHOT/my-dep-1.0-SNAPSHOT.pom [warn] ==== Typesafe Releases Repository: tried [warn] http://repo.typesafe.com/typesafe/releases/org/package/my-dep/1.0-SNAPSHOT/my-dep-1.0-SNAPSHOT.pom 

Dependencies are in my ~ / .ivy2 / cache directory. I also have other dependencies that are not marked as snapshots, and it seems like IntelliJ has no problem finding them. This applies only to snapshots.

Update

It seems that IDEA is ignoring my ~ / .sbt / repositories file, where the snapshot repository is defined and uses the default SBT plugin configuration.

Is it possible to configure IDEA to use its custom repository definition?

+5
source share
1 answer

I tried effortlessly installing a custom sbt launcher in Settings -> SBT -> Launcher -> Custom.

enter image description here

After starting my application with Run Configuration , I could see in the logs that, for some reason, the startup program that I specified was overridden by another that was part of the Scala plugin.

 -Dsbt.global.base=C:\Users\User\AppData\Local\Temp\sbt-global-plugin3401565420094215394stub -classpath C:\Users\User\.IntelliJIdea13\config\plugins\Scala\launcher\sbt-launch.jar 

Finally, I managed to get IDEA to use my ~ / .sbt / repositories by adding -Dsbt.repository.config=C:\Users\User\.sbt\repositories to the startup parameters of the JVM configuration.

enter image description here

I also set -Dsbt.override.build.repos = true to make sure that only the repositories listed in my custom configuration are used.

+3
source

Source: https://habr.com/ru/post/1206886/


All Articles