在SBT多项目构建中Maven下的RootProject的依赖关系被忽略了吗?

时间:2014-01-27 10:19:16

标签: scala maven sbt ivy

SBT似乎忽略了pom.xml为多项目构建定义的依赖关系:

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

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

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`

riak-java-client项目应导入其pom.xml中定义的所有库,但不导入任何内容。

1 个答案:

答案 0 :(得分:1)

RootProjectProjectRef(一般只是ProjectReference)将引用SBT项目,以便它们完全可解析并正确处理其依赖项(通过适当的{{1}对于file,svn,git和hg)。然而,它不适用于非SBT项目 - 在Maven,Ant,Gradle或类似项目下。只是SBT的。

您可能想尝试externalPom。我没有,所以不能评论它的使用。