score:7
sbt-idea refers to the libraries in the locations that sbt
refers to them, which by default is under ~/.ivy2/cache
.
Here's how it looks on my system, with a fresh project, SBT 0.11.2, and sbt-idea 0.11.0:
~/code/scratch/20120225 sbt
[info] Loading global plugins from /Users/jason/.sbt/plugins
[info] Set current project to default-d73535 (in build file:/Users/jason/code/scratch/20120225/)
> set libraryDependencies += "org.scalaz" %% "scalaz-core" % "6.0.3"
[info] Reapplying settings...
[info] Set current project to default-d73535 (in build file:/Users/jason/code/scratch/20120225/)
> session save
[info] Reapplying settings...
[info] Set current project to default-d73535 (in build file:/Users/jason/code/scratch/20120225/)
> gen-idea no-sbt-classifiers
[info] Trying to create an Idea module default-d73535
[info] Resolving org.scala-lang#scala-library;2.9.1 ...
[info] Resolving org.scalaz#scalaz-core_2.9.1;6.0.3 ...
[info] Excluding folder target
[info] Created /Users/jason/code/scratch/20120225/.idea/IdeaProject.iml
[info] Created /Users/jason/code/scratch/20120225/.idea
[info] Excluding folder /Users/jason/code/scratch/20120225/target
[info] Created /Users/jason/code/scratch/20120225/.idea_modules/default-d73535.iml
[info] Created /Users/jason/code/scratch/20120225/.idea_modules/project.iml
~/code/scratch/20120225 grep jar /Users/jason/code/scratch/20120225/.idea/libraries/*.xml
/Users/jason/code/scratch/20120225/.idea/libraries/org_scala_lang_scala_library_2_9_1.xml: <root url="jar://$USER_HOME$/.sbt/boot/scala-2.9.1/lib/scala-library.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/org_scala_lang_scala_library_2_9_1.xml: <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang/scala-library/docs/scala-library-2.9.1-javadoc.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/org_scala_lang_scala_library_2_9_1.xml: <root url="jar://$USER_HOME$/.ivy2/cache/org.scala-lang/scala-library/srcs/scala-library-2.9.1-sources.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/org_scalaz_scalaz_core_2_9_1_6_0_3.xml: <root url="jar://$USER_HOME$/.ivy2/cache/org.scalaz/scalaz-core_2.9.1/jars/scalaz-core_2.9.1-6.0.3.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/org_scalaz_scalaz_core_2_9_1_6_0_3.xml: <root url="jar://$USER_HOME$/.ivy2/cache/org.scalaz/scalaz-core_2.9.1/docs/scalaz-core_2.9.1-6.0.3-javadoc.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/org_scalaz_scalaz_core_2_9_1_6_0_3.xml: <root url="jar://$USER_HOME$/.ivy2/cache/org.scalaz/scalaz-core_2.9.1/srcs/scalaz-core_2.9.1-6.0.3-sources.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/scala_2_9_1.xml: <root url="jar://$USER_HOME$/.sbt/boot/scala-2.9.1/lib/scala-library.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/scala_2_9_1.xml: <root url="jar://$USER_HOME$/.sbt/boot/scala-2.9.1/lib/scala-compiler.jar!/"></root>
However, SBT has a configuration setting, retrieve-managed
to use make a build-local copy of all libraries, rather than directly referring to them from the cache. If you have this enabled, sbt-idea
will also setup the IntelliJ classpath to refer to these.
Here's the help:
> help retrieve-managed
If true, enables retrieving dependencies to the current build. Otherwise, dependencies are used directly from the cache.
Let's try it out:
> set retrieveManaged in ThisBuild := true
[info] Reapplying settings...
[info] Set current project to default-d73535 (in build file:/Users/jason/code/scratch/20120225/)
> update
[info] Updating {file:/Users/jason/code/scratch/20120225/}default-d73535...
[info] Resolving org.scala-lang#scala-library;2.9.1 ...
[info] Resolving org.scalaz#scalaz-core_2.9.1;6.0.3 ...
[info] Done updating.
[success] Total time: 1 s, completed Feb 25, 2012 9:07:41 AM
> show compile:dependency-classpath
[info] Updating {file:/Users/jason/code/scratch/20120225/}default-d73535...
[info] Resolving org.scala-lang#scala-library;2.9.1 ...
[info] Resolving org.scalaz#scalaz-core_2.9.1;6.0.3 ...
[info] Done updating.
[info] ArrayBuffer(Attributed(/Users/jason/.sbt/boot/scala-2.9.1/lib/scala-library.jar), Attributed(/Users/jason/code/scratch/20120225/lib_managed/jars/org.scalaz/scalaz-core_2.9.1/scalaz-core_2.9.1-6.0.3.jar))
[success] Total time: 0 s, completed Feb 25, 2012 9:07:54 AM
> gen-idea no-sbt-classifiers
[info] Trying to create an Idea module default-d73535
[info] Resolving org.scala-lang#scala-library;2.9.1 ...
[info] Resolving org.scalaz#scalaz-core_2.9.1;6.0.3 ...
[info] Excluding folder target
[info] Created /Users/jason/code/scratch/20120225/.idea/IdeaProject.iml
[info] Created /Users/jason/code/scratch/20120225/.idea
[info] Excluding folder /Users/jason/code/scratch/20120225/target
[info] Created /Users/jason/code/scratch/20120225/.idea_modules/default-d73535.iml
[info] Created /Users/jason/code/scratch/20120225/.idea_modules/project.iml
~/code/scratch/20120225 grep jar /Users/jason/code/scratch/20120225/.idea/libraries/*.xml
/Users/jason/code/scratch/20120225/.idea/libraries/org_scala_lang_scala_library_2_9_1.xml: <root url="jar://$USER_HOME$/.sbt/boot/scala-2.9.1/lib/scala-library.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/org_scala_lang_scala_library_2_9_1.xml: <root url="jar://$PROJECT_DIR$/lib_managed/docs/org.scala-lang/scala-library/scala-library-2.9.1-javadoc.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/org_scala_lang_scala_library_2_9_1.xml: <root url="jar://$PROJECT_DIR$/lib_managed/srcs/org.scala-lang/scala-library/scala-library-2.9.1-sources.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/org_scalaz_scalaz_core_2_9_1_6_0_3.xml: <root url="jar://$PROJECT_DIR$/lib_managed/jars/org.scalaz/scalaz-core_2.9.1/scalaz-core_2.9.1-6.0.3.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/org_scalaz_scalaz_core_2_9_1_6_0_3.xml: <root url="jar://$PROJECT_DIR$/lib_managed/docs/org.scalaz/scalaz-core_2.9.1/scalaz-core_2.9.1-6.0.3-javadoc.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/org_scalaz_scalaz_core_2_9_1_6_0_3.xml: <root url="jar://$PROJECT_DIR$/lib_managed/srcs/org.scalaz/scalaz-core_2.9.1/scalaz-core_2.9.1-6.0.3-sources.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/scala_2_9_1.xml: <root url="jar://$USER_HOME$/.sbt/boot/scala-2.9.1/lib/scala-library.jar!/"></root>
/Users/jason/code/scratch/20120225/.idea/libraries/scala_2_9_1.xml: <root url="jar://$USER_HOME$/.sbt/boot/scala-2.9.1/lib/scala-compiler.jar!/"></root>
Source: stackoverflow.com
Related Query
- How to set up an IntelliJ Idea Scala project to recognize local Ivy2 cache?
- How to set up a scala project in IntelliJ IDEA that uses git libraries
- How to set up Java and Scala in one single Module in Intellij IDEA 11?
- How to set up IntelliJ Idea to highlight library types in Scala code?
- Scala code compiles through command-line sbt but fails when compiled through Intellij Idea - how set up Intellij to use external sbt?
- How to build Android project with Scala sources in IntelliJ IDEA (Community Edition)?
- Set changing scala project dependency in Intellij IDEA 14 (for code completion and inspection)
- How do I set Scala 2.10.3 Docs API to be used in Intellij IDEA 12?
- How to use Scala in IntelliJ IDEA (or: why is it so difficult to get a working IDE for Scala)?
- How to add Jar libraries to an IntelliJ Idea SBT Scala project?
- How do I change intellij idea to compile with scala 2.11?
- Scala Compiler not found in Intellij IDEA 11 with Play 2.0 project
- IntelliJ IDEA 13: new Scala SBT project hasn't src directory structure generated
- How to run scala code on Intellij Idea 11?
- How to debug a scala based Spark program on Intellij IDEA
- How to get Scala imports working in IntelliJ IDEA with the Play framework?
- Attaching sources in IntelliJ IDEA for scala project
- How do I get Intellij IDEA 12.0 to work with Play Framework 2.1.0 app and Scala 2.10.0?
- How to run Scala code in Intellij Idea 10
- How to set up a local development environment for Scala Spark ETL to run in AWS Glue?
- How to run tests on every code change in IntelliJ IDEA from Scala sbt project?
- How to know if a Scala file modified with IntelliJ Idea is saved and if it is checked into CVS?
- How to get IntelliJ to recognize imports in Scala script?
- How to setup sbt/scala/play multi-module project which will work fine with Intellij scala plugin
- How do I make intellij Idea to highlight Scala script correctly with #! (shebang)
- How to set up IDEA to auto-configure Scala facet for mixed Scala/Java Maven project?
- Intellij Idea add Scala support to existing Java project
- How to synchronize Intellij and sbt builds for a scala project
- How to configure code style for Scala in IntelliJ IDEA
- How do I set the scala sdk using gradle in Idea module?
More Query from same tag
- Can't get the Scala tools to work in Odersky's Coursera course
- Set Heroku environment variable as a function of another dynamic (Heroku-managed) variable
- Convert Scala countvectorizer output to libsvm format
- How to convert Map to case class (recursively)
- scala sbt: how to find out and download dependencies automatically just like go get?
- How to fix this typeclass example?
- How to sequence Throwable \/ List[Throwable \/ A] into Throwable \/ List[A] in scalaz?
- Scala pipe patternmatching as a variable
- Scala compilation error in IntelliJ: could not find an output directory
- How to add Options to a List
- Overriding trait method with default parameter
- Does Scala allow for the arbitrary instantiation of generic objects? new B {}?
- Cannot change storage level of RDD
- list of string matching with input string
- SBT: How to access environment variable or configuration?
- Getting map function with custom CanBuildFrom and Builder to work in Scala
- Scala - Dealing with null JSON objects
- Is it possible to defer macro expansion until abstract type is bound to specific type
- Spark ElasticSearch query missing fields in dataframe
- Json format with Play 2.4 / Scala
- Key corresponding to max value in a spark map column
- Scala: Chaining futures, returning the first
- Implicit value not found in method to method call
- How to move selected columns of a DataFrame to the end of it (re arranging the column positions)?
- jsonschema.core.exceptions.InvalidSchemaException: fatal: core.invalidSchema level: "fatal"
- How to create a circular reference in Scala?
- reading from a spark.structType in scala
- Possible to communicate with a remote actor from a non-actor?
- janus vim-plugin autocompiling scala
- Missing dependencies in Apache Crunch Scala build