同时使用本地Artifactory服务器获取Maven和SBT [英] Getting both Maven and SBT use local Artifactory-server

查看:145
本文介绍了同时使用本地Artifactory服务器获取Maven和SBT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要同时使用Maven和SBT才能使用本地Artifactory服务器,这是唯一具有Internet连接的机器.服务器,CI机器等无法访问外界.

I need to get both Maven and SBT to use local Artifactory-server which is only machine that has Internet connection. Servers, CI-machine, etc don't have access to outside world.

尤其是SBT,我的头发越来越白.

I'm getting grey hair with SBT especially.

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

With 0.11.[0..3] I can SBT to access Artifactory via following:

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

对于0.12或0.13版本,我没有运气.我尝试使用此处找到的说明: https://github.com/harrah/xsbt/pull/472 .因此,我完成了以下操作:

With 0.12 or 0.13 versions I have no luck. I've tried with instructions found here: https://github.com/harrah/xsbt/pull/472. So I have done following:

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

  • I've built SBT myself
  • I've put 'repositories' file into ~/.sbt/
  • 'repositories' file includes:

[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',现在看起来像这样:

I've included '-Dsbt.override.build.repos=true' in SBT's launch command which looks like this now:

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,但尝试直接连接到Typesafe,Maven Central等.

But 0.12 and 0.13 refuse to access Artifactory but try to connect directly to typesafe, maven central etc.

现在,对于0.11系列的SBT,我可以将其连接到Artifactory.然后就有一个问题,即SBT无法找到编译项目所需的软件包.这是示例:

Now for 0.11-series of SBT I can get it to connect to Artifactory. Then there is problem that SBT is unable to find packages it needs for compiling the project. Here is example:

==== 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

这显然与Artifactory配置有关.如果有人对我应该如何与Artifactory一起使用什么存储库以及如何在SBT上成功使用它,我将不胜感激.

This must obviously be something related to Artifactory configuration. I would appreciate if someone has any pointers how and what repositories I should proxy with Artifactory in order to succesfully use it with SBT.

推荐答案

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

I have the following scala-friendly repositories set up for our work environment:

  • Scala Tools: https://oss.sonatype.org/content/groups/scala-tools/
  • TypeSafe: http://repo.typesafe.com/typesafe/releases/
  • JFrog: http://repo.jfrog.org/artifactory/libs-releases-local

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

The compiler interface you mentioned above is in the Typesafe repository, specifically

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

这篇关于同时使用本地Artifactory服务器获取Maven和SBT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆