I have a Play 2.3 Scala project which runs perfectly when started with the activator run command. However, if I try to start it in IntelliJ 13 from the Run/Debug Configurations option there's a problem with resolving snapshot dependencies.
According to logs following repositories has been checked in order to find dependencies:
[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 present at my ~/.ivy2/cache directory. I also have there other dependencies which aren't marked as snapshots and it looks like IntelliJ doesn't have a problem with finding them. It only applies to snapshots.
Update
It looks like IDEA ignores my ~/.sbt/repositories file where snapshot repository is defined and uses default SBT plugin configuration.
Is it actually possible to configure IDEA so it would use my custom repository definition?
I tried without success to set custom sbt-launcher in Settings -> SBT -> Launcher -> Custom.
After I run my application with Run configuration I could see in the logs that for some reason launcher that I specified was overridden by another which 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 force IDEA to use my ~/.sbt/repositories by adding -Dsbt.repository.config=C:\Users\User\.sbt\repositories
to the Run Configuration JVM Options.
I have also set -Dsbt.override.build.repos=true to make sure that only repositories listed in my custom configuration are used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With