加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

scala – SBT中范围库依赖关系的具体语法?

发布时间:2020-12-16 19:09:08 所属栏目:安全 来源:网络整理
导读:http://www.scala-sbt.org/0.12.2/docs/Getting-Started/Library-Dependencies.html If you want a dependency to show up in the classpath only for the Test configuration and not the Compile configuration,add % “test” like this: libraryDependen
http://www.scala-sbt.org/0.12.2/docs/Getting-Started/Library-Dependencies.html

If you want a dependency to show up in the classpath only for the Test
configuration and not the Compile configuration,add % “test” like
this:

libraryDependencies += "org.apache.derby" % "derby" % "10.4.1.3" % "test"

有人可以解释为什么我们用这个符号吗?我的意思是配置在最后?

为什么我们不写这样的东西:

libraryDependencies in Test += "org.apache.derby" % "derby" % "10.4.1.3"

解决方法

配置为最后的字符串是 Ivy configuration,更准确地描述为配置映射.在测试中不涵盖所有用例,尽管它覆盖了常见的用例.

0.13的Detailed-Topics/Dependency-Management页也有更多的信息.配置是常春藤功能.他们可以被认为是Maven范围的泛化.

请注意,除了Maven范围之外,任何以ivy.xml形式的元数据都需要.发布到本地存储库的元数据发布到常春藤存储库,或在发布之前在本地构建中使用的元数据就是这种情况.来自Maven Central的pom.xml形式的元数据仅限于标准的Maven范围.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读