SBT 获取 Ivy*.xml 文件和 jar 依赖项,但不获取 jar 本身



我在我的build.sbt文件中提到了一个jar(属于我组织的工件)

lazy val core =
module("core", deps = Seq(
"io.swagger" % "swagger-annotations" % "1.5.8"
)).settings(
libraryDependencies ++= Seq(
"com.quantcast" % "quantserve_shared" % "latest.integration"
))

当我编译代码时,我看到这些文件被下载到我的 ~/.ivy2 目录中,但没有下载 jars 文件夹或任何 jar。

ls ./cache/com.quantcast/quantserve_shared/
ivy-3.5.3132.xml                        ivy-3.5.3132.xml.original               ivydata-3.5.3132.properties             ivydata-latest.integration.properties

我检查了我的分辨率缓存/报告/受众链接核心受众链接core_2.11-编译内部.xml文件,看到这个:

<module organisation="com.quantcast" name="quantserve_shared">
<revision name="3.5.3132" status="release" pubdate="20170315145341" resolver="sbt-chain" artresolver="sbt-chain" downloaded="false" searched="true" default="false" conf="compile, default(compile)" position="74">
<metadata-artifact status="no" details="" size="7161" time="0" location="/Users/pkhurana/.ivy2/cache/com.quantcast/quantserve_shared/ivy-3.5.3132.xml" searched="true" origin-is-local="false" origin-location="http://<My org artifactory>/libs-bmr-releases-local/com/quantcast/quantserve_shared/3.5.3132/ivy-3.5.3132.xml"/>
<caller organisation="audience-link-core" name="audience-link-core_2.11" conf="compile-internal, compile, provided, optional" rev="latest.integration" rev-constraint-default="latest.integration" rev-constraint-dynamic="latest.integration" callerrev="0.9999999.17.76.111418"/>
<artifacts>
</artifacts>
</revision>
</module>

所以工件标签中没有任何内容,但我确实看到其他 jar 是 jar 的依赖项quantserve_shared被下载并且它们在分辨率缓存中的条目也很好。

<module organisation="com.twitter.util-core" name="util-core">
<revision name="1.12.13" status="release" pubdate="20131024042503" resolver="sbt-chain" artresolver="sbt-chain" homepage="" downloaded="false" searched="false" default="false" conf="default, compile, runtime, master" position="127">
<metadata-artifact status="no" details="" size="2240" time="0" location="/Users/pkhurana/.ivy2/cache/com.twitter.util-core/util-core/ivy-1.12.13.xml" searched="false" origin-is-local="true" origin-location="/Users/pkhurana/.ivy2/quantcast-bmr/com.twitter.util-core/util-core/ivy-1.12.13.xml"/>
<caller organisation="com.quantcast" name="quantserve_shared" conf="compile" rev="1.12.13" rev-constraint-default="1.12.13" rev-constraint-dynamic="1.12.13" callerrev="3.5.3132"/>
<artifacts>
<artifact name="util-core" type="jar" ext="jar" status="no" details="" size="632306" time="0" location="/Users/pkhurana/.ivy2/quantcast-bmr/com.twitter.util-core/util-core/jars/util-core-1.12.13.jar">
<origin-location is-local="true" location="/Users/pkhurana/.ivy2/quantcast-bmr/com.twitter.util-core/util-core/jars/util-core-1.12.13.jar"/>
</artifact>
</artifacts>
</revision>
</module>

不知道为什么,但最新的 sbt (0.13.15) 确实下载了所有内容

发生这种情况是因为依赖项 jar 没有在其 ivy 文件中指定的配置"编译"。它指定了"主",并公开可见性。现在 sbt 默认尝试查找"编译",但失败了。 通过将其更改为

"com.quantcast" % "quantserve_shared" % "3.5.3166" % "compile->master"

最新更新