添加凭据以允许Travis-CI使用专用的Nexus存储库

sch*_*mmd 5 nexus sbt travis-ci

我正在使用Travis进行持续集成.但是,我的项目依赖于私有的Nexus存储库.我宁愿不将sbt凭证签入我们的存储库.Travis确实支持加密密钥,但它们只影响环境变量.

如何让Travis对Nexus进行身份验证? sbt似乎不支持环境变量的凭据.

https://github.com/sbt/sbt/blob/0.13/launch/src/main/scala/xsbt/boot/Update.scala#L56

看起来支持从环境变量指定凭证文件,或将凭证指定为系统属性.不幸的是,这似乎没有用0.13.

sbt -Dsbt.boot.realm="Sonatype Nexus Repository Manager" -Dsbt.boot.host="www.there.com" -Dsbt.boot.user="deployment" -Dsbt.boot.password="password" aether-deploy
Run Code Online (Sandbox Code Playgroud)

Mic*_*ier 2

您可以在 .travis.yml 中设置全局变量,如下定义: http://docs.travis-ci.com/user/build-configuration/#Set-environment-variables

可以使用 travis gem 为 travis 加密这些全局变量。解释如下: How to use travis-ci's .travis.yml to Provideenvironmentparameters for Node.js Application?