Repositories file not being used?
Does the sbt plugin not read from the repositories file correctly? We have a proxy repository defined as specified here: http://www.scala-sbt.org/0.13/docs/Proxy-Repositories.html.
The file is pretty simple. Something like:
[repositories]
local
mycompany: https://artifactory.mycompany.com/artifactory/repo
typesafe-ivy-releases: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
When I launch sbt from the command-line everything works correctly. When I run sbt import, it appears to only check local and maven central. Artifacts not defined in maven central aren't resolved. This means my company's locally published artifacts and a few others (lift widgets 3.0 snapshot, for example) cause the project from importing correctly.
I get an error that it couldn't resolve the artifact and that it only checked in local and public.
Any ideas?
请先登录再写评论。
I also have a sample project that should reproduce the issue. It's pretty simple.
Set the repositories file to this:
[repositories]
local
typesafe-ivy-releases: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
sonatype-releases: https://oss.sonatype.org/content/repositories/releases
sonatype-snapshots: https://oss.sonatype.org/content/repositories/snapshots
Then create a project with only a build.sbt file with the following content:
organization := "com.myorg"
name := "idea-resolvers-test"
libraryDependencies += "net.liftmodules" %% "widgets_3.0" % "1.3-SNAPSHOT"
Hi Austen!
Currently we have to substituting the global SBT settings directory to dynamically load the sbt-structure plugin (that extracts project structure).
We'll try to find/propose a better way to achieve that goal.
Meanwhile, as a workaround, you may mirror required global SBT settings in SBT directory withing the IDEA system directory (which is used for launching SBT process from IDEA).
Corresponding issue in YouTrack: SCL-6278
That worked. We have authentication on our repository, too, so I had to put a file adding credentials in a bunch of places.
Thanks for the tip,
-Austen
We've modified how we launch SBT process with the sbt-structure plugin (now we're relying on the "apply" SBT command). Currently, the updated code is included in IDEA 13-targeted plugin nightly builds, so you may try them.
That should fix all the problems with global SBT settings, excessive settings recompilation and excessive SBT boot jars downloading (and speedup project reading).
However, the new approach is only compatible with SBT 0.12.4+, so please update explicit sbt.version property (if present) in your projects. Anyway, it's a recommended practice to always update SBT to the newest version.