【发布时间】:2017-02-18 13:12:10
【问题描述】:
我正在尝试使用global.sbt 中的未加密密码访问 Nexus OSS 存储库,例如 this,我的 global.sbt 是:
credentials += Credentials("Sonatype Nexus", "repo.example.com", "username", "unencrypted_password")
我想考虑设置加密密码。
【问题讨论】:
我正在尝试使用global.sbt 中的未加密密码访问 Nexus OSS 存储库,例如 this,我的 global.sbt 是:
credentials += Credentials("Sonatype Nexus", "repo.example.com", "username", "unencrypted_password")
我想考虑设置加密密码。
【问题讨论】:
您可以在~/.ivy2/.credentials 下创建一个名为.credentials 的文件。这是一个相当标准的位置,但显然您可以将文件放在磁盘上的任何位置。
文件如下所示:
realm = Sonatype Nexus Repository Manager
host = oss.sonatype.org
user = publishing@yourco.com
password = $encrypted
要加密密码,您可以使用已知的 AES 密码,这意味着您基本上可以执行以下操作:
val credential: DirectCredentials = Credentials(Path.userHome / ".ivy2" / ".credentials")
val decrypted = credential.copy(passwd = decryptAes(credential.passwd))
现在您需要的是公司范围内或类似公司的共享密码,以及解密 AES 的方法,并且看起来像 here。
【讨论】: