让Maven和SBT都使用本地Artifactory-server

amj*_*mjr 7 scala artifactory maven sbt

我需要让Maven和SBT都使用本地Artifactory-server,这只是具有Internet连接的机器.服务器,CI机器等无法访问外部世界.

我特别喜欢SBT的白发.

连接到Artifactory的SBT问题

使用0.11.[0..3]我可以通过以下方式访问Artifactory:

  • 解压缩sbt-launcher.jar
  • 获取sbt.boot.properties并将其复制到某处
  • 编辑sbt.boot.properties以仅包含"本地"存储库和我们的Artifactory服务器

有0.12或0.13版本我没有运气.我试过这里的说明:https://github.com/harrah/xsbt/pull/472.所以我做了以下事情:

  • 我自己建造了SBT
  • 我将'存储库'文件放入〜/ .sbt /
  • '存储库'文件包括:

    [repositories]

    local

    ivy-proxy: http://devserver:8081/artifactory/repo/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]

    maven-proxy: http://devserver:8081/artifactory/repo/

  • 我在SBT的启动命令中包含了'-Dsbt.override.build.repos = true',现在看起来像这样:

    java -Xms1536m -Xmx1536m -XX:MaxPermSize=384m -XX:ReservedCodeCacheSize=192m -Dsbt.override.build.repos=true -Dsbt.global.base=/Users/amjr/.sbt/0.13.0-SNAPSHOT -jar /Users/amjr/.bin/.lib/0.13.0-SNAPSHOT/sbt-launch.jar

但0.12和0.13拒绝访问Artifactory但尝试直接连接到类型安全,maven中心等.

SBT确实访问它时的工具和问题

现在,对于0.11系列的SBT,我可以将它连接到Artifactory.然后存在SBT无法找到编译项目所需的包的问题.这是一个例子:

==== local-artifactory-libs-snapshot: tried

  http://devserver:8081/artifactory/libs-snapshot/org/scala-sbt/compiler-interface/0.11.3/compiler-interface-src-0.11.3.jar

==== local-artifactory-libs-releases: tried

  http://devserver:8081/artifactory/libs-release/org/scala-sbt/compiler-interface/0.11.3/compiler-interface-src-0.11.3.jar

==== local-artifactory-plugins-releases: tried

  http://devserver:8081/artifactory/plugins-release/org/scala-sbt/compiler-interface/0.11.3/compiler-interface-src-0.11.3.jar
Run Code Online (Sandbox Code Playgroud)

这显然必须与Artifactory配置相关.我很感激,如果有人有任何指针,我应该使用Artifactory代理什么存储库,以便成功地将它与SBT一起使用.

Mad*_*Dog 4

我为我们的工作环境设置了以下 scala 友好的存储库:

您上面提到的编译器接口位于 Typesafe 存储库中,具体来说

http://repo.typesafe.com/typesafe/maven-ivy-releases/org.scala-sbt/compiler-interface/0.11.3/