Question

SBT seems to be ignoring dependencies defined in pom.xml for multi-project builds:

object ApplicationBuild extends Build {
  lazy val project = Project("root", file(".")).dependsOn(RootProject(riakJavaClient))

  lazy val riakJavaClient = uri("git://github.com/basho/riak-java-client")
}

Output from dependency-graph:

[info]                                                          +-------------------+                                                        
[info]                                                          |my-project_2.10 [S]|                                                        
[info]                                                          |    my-project     |                                                        
[info]                                                          |        1.0        |                                                        
[info]                                                          +-------------------+                                                        
[info]                                                               |      ||   |                                                            
[info]                                   -----------------------------      ||   --------------------------------------                       
[info]                                   |                                  |---------------                          |                       
[info]                                   |                                  ---------------|                          |                       
[info]                                   v                                                ||                          |                       
[info]                     +---------------------------+                                  ||                          |                       
[info]                     |unfiltered-scalate_2.10 [S]|                                  ||                          |                       
[info]                     |      net.databinder       |                                  ||                          |                       
[info]                     |           0.6.8           |                                  ||                          |                       
[info]                     +---------------------------+                                  ||                          |                       
[info]                           |       |      |                                         ||                          |                       
[info]                           |       |      ----------------------------              ||                          |                       
[info]                           |       -----------------                 |              ||                          |                       
[info]                           v                       |                 |              ||                          |                       
[info]               +----------------------+            |                 |              ||                          |                       
[info]               |  scalate-core_2.10   |            |                 |              ||                          |                       
[info]               |org.fusesource.scalate|            |                 |              ||                          |                       
[info]               |        1.6.1         |            |                 |              ||                          |                       
[info]               +----------------------+            |                 |              ||                          |                       
[info]                  |        |     |                 |                 |              ||                          |                       
[info]                  |        |     ------            |                 |              ||                          |                       
[info]                  |        ---------  |            |                 |              ||                          |                       
[info]                  v                |  |            |                 v              ||                          v                       
[info]        +------------------+       |  |            |       +-------------------+    ||                 +-----------------+              
[info]        |scala-compiler [S]|       |  |            |       |unfiltered_2.10 [S]|    ||                 |commons-validator|              
[info]        |  org.scala-lang  |       |  |            |       |  net.databinder   |    ||                 |commons-validator|              
[info]        |      2.10.0      |       |  |            |       |       0.6.8       |    ||                 |      1.4.0      |              
[info]        +------------------+       |  |            |       +-------------------+    ||                 +-----------------+              
[info]           |          | ------------  |            |              |  |    |         ||                      |  |    |                   
[info]           |          | |             |            |              |  |    --------- ||           ------------  |    ------------        
[info]           |          | |             |            |              |  ------------ | ||           |             |               |        
[info]           v          | |             v            |              v             | | ||           v             |               |        
[info]  +-----------------+ | | +----------------------+ | +------------------------+ | | ||  +-----------------+    |               |        
[info]  |scala-reflect [S]| | | |scalate-util_2.10 [S] | | |unfiltered-util_2.10 [S]| | | ||  |commons-beanutils|    |               |        
[info]  | org.scala-lang  | | | |org.fusesource.scalate| | |     net.databinder     | | | ||  |commons-beanutils|    |               |        
[info]  |     2.10.0      | | | |        1.6.1         | | |         0.6.8          | | | ||  |      1.8.3      |    |               |        
[info]  +-----------------+ | | +----------------------+ | +------------------------+ | | ||  +-----------------+    |               |        
[info]       |    ----------- ----      |       |        |              |             | | ||           |             |               |        
[info]       |    |              |      |       |        |              |             | | ||           ----------    |               |        
[info]       |    |    ------------------       |        |              |             | | ||                    |    |               |        
[info]       |    |    |         |  -------------        |              |             | | ||                    |    |               |        
[info]       |    |    |         |  |        -------------              |             | | ||                    |    |               |        
[info]       |    |    |         |  |        |   ------------------------             | | ||                    |    |               |        
[info]       |    |    |         |  |        |   |   ---------------------------------- | ||                    |    |               |        
[info]       |    |    |         |  |        |   |   |   -------------------------------|--|                    |    |               |        
[info]       |    |    |         |  |        |   |   |   |           --------------------  |                    |    |               |        
[info]       |    |    |         |  |        |   |   |   |           |                     |                    |    |               |        
[info]       v    v    v         v  v        v   v   v   v           v                     v                    v    v               v        
[info]  +------------------+ +---------+ +------------------+ +-------------+ +-------------------------+ +---------------+ +----------------+
[info]  |  scala-library   | |slf4j-api| |  scala-library   | |commons-codec| |riak-java-client_2.10 [S]| |commons-logging| |commons-digester|
[info]  |  org.scala-lang  | |org.slf4j| |  org.scala-lang  | |commons-codec| |         default         | |commons-logging| |commons-digester|
[info]  |      2.10.0      | |  1.6.1  | |      2.10.1      | |     1.4     | |      0.1-SNAPSHOT       | |     1.1.1     | |      1.8       |
[info]  |evicted by: 2.10.2| +---------+ |evicted by: 2.10.2| +-------------+ +-------------------------+ +---------------+ +----------------+
[info]  +------------------+             +------------------+                                                                                 
[info] Note: The old tree layout is still available by using `dependency-tree`

The riak-java-client project should import all the libraries defined in its pom.xml, but is importing nothing.

Was it helpful?

Solution

RootProject and ProjectRef (just ProjectReference's in general) are to reference SBT projects so they fully resolvable and their dependencies handled properly (via appropriate Resolvers for file, svn, git and hg). It won't however work with non-SBT projects - under Maven, Ant, Gradle or similar. Just SBT ones.

You may want to give externalPom a try. I didn't, so can't comment on its use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top