我使用bintray和 sbt "publish" 命令上传了一个包...
[info] delivering ivy file to /home/johnreed/sbtProjects/scala-trace-debug/target/scala-2.11/ivy-0.1.1.xml
[info] Wrote /home/johnreed/sbtProjects/scala-trace-debug/target/scala-2.11/scala-trace-debug_2.11-0.1.1.pom
[info] Packaging /home/johnreed/sbtProjects/scala-trace-debug/target/scala-2.11/scala-trace-debug_2.11-0.1.1.jar ...
[info] Done packaging.
[info] published scala-trace-debug_2.11 to https://api.bintray.com/maven/johnreed2/maven/maven/scala-trace-debug/scala-trace-debug_2.11/0.1.1/scala-trace-debug_2.11-0.1.1.pom
[info] published scala-trace-debug_2.11 to https://api.bintray.com/maven/johnreed2/maven/maven/scala-trace-debug/scala-trace-debug_2.11/0.1.1/scala-trace-debug_2.11-0.1.1.jar
[info] published scala-trace-debug_2.11 to https://api.bintray.com/maven/johnreed2/maven/maven/scala-trace-debug/scala-trace-debug_2.11/0.1.1/scala-trace-debug_2.11-0.1.1-sources.jar
[info] published scala-trace-debug_2.11 to https://api.bintray.com/maven/johnreed2/maven/maven/scala-trace-debug/scala-trace-debug_2.11/0.1.1/scala-trace-debug_2.11-0.1.1-javadoc.jar
[info] johnreed2/scala-trace-debug@0.1.1 was released
[success]
这是我生成的 Maven pom 文件...
<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>scala-trace-debug</groupId>
<artifactId>scala-trace-debug_2.11</artifactId>
<packaging>jar</packaging>
<description>scala-trace-debug</description>
<version>0.1.1</version>
<licenses>
<license>
<name>Apache-2.0</name>
<url>https://opensource.org/licenses/Apache-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<name>scala-trace-debug</name>
<organization>
<name>scala-trace-debug</name>
</organization>
...
^ 我想将这个已发布的 sbt 项目包含到另一个 sbt 项目中。
我尝试将其添加到我的其他项目的 build.sbt 文件中:
// Format: libraryDependencies += groupID % artifactID % revision
libraryDependencies += "scala-trace-debug" % "scala-trace-debug_2.11" % "0.1.1"
但它不起作用。
我明白了:
Error:Error while importing SBT project:<br/>...<br/><pre>[info] Resolving org.scala-sbt#run;0.13.9 ...
[info] Resolving org.scala-sbt#task-system;0.13.9 ...
[info] Resolving org.scala-sbt#tasks;0.13.9 ...
[info] Resolving org.scala-sbt#tracking;0.13.9 ...
[info] Resolving org.scala-sbt#cache;0.13.9 ...
[info] Resolving org.scala-sbt#testing;0.13.9 ...
[info] Resolving org.scala-sbt#test-agent;0.13.9 ...
[info] Resolving org.scala-sbt#test-interface;1.0 ...
[info] Resolving org.scala-sbt#main-settings;0.13.9 ...
[info] Resolving org.scala-sbt#apply-macro;0.13.9 ...
[info] Resolving org.scala-sbt#command;0.13.9 ...
[info] Resolving org.scala-sbt#logic;0.13.9 ...
[info] Resolving org.scala-sbt#precompiled-2_8_2;0.13.9 ...
[info] Resolving org.scala-sbt#precompiled-2_9_2;0.13.9 ...
[info] Resolving org.scala-sbt#precompiled-2_9_3;0.13.9 ...
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[trace] Stack trace suppressed: run 'last *:ssExtractDependencies' for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: scala-trace-debug#scala-trace-debug_2.11;0.1.1: not found
[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: scala-trace-debug#scala-trace-debug_2.11;0.1.1: not found
[error] Total time: 3 s, completed Mar 25, 2016 5:17:01 PM</pre><br/>See complete log in <a href="/home/johnreed/.IdeaIC2016.1/system/log/sbt.last.log">/home/johnreed/.IdeaIC2016.1/system/log/sbt.last.log</a>
如何让 sbt 获取发布到我的 bintray 存储库的 repo?