带有SBT的Jenkins中的Nexus凭据 [英] Nexus credentials in Jenkins with sbt
问题描述
我正试图做一个联系工作,以发布一个罐子到联系.我在scala中使用sbt,并且我有一个带有所需凭据的配置文件.我在运行sbt publish
时遇到麻烦,这给了我未授权的错误.我需要能够将我的凭据链接到我的sbt版本.我正在尝试将配置的目标设置为~/.ivy2/.credentials
,但似乎无法正常工作.有人对如何解决此问题有任何建议吗?
I'm trying to make a nexus job to publish a jar to nexus. I'm using sbt with scala, and I have a configuration file with the required credentials in it. I'm having trouble when I run sbt publish
, it's giving me unauthorized errors. I need to be able to link my credentials to my sbt build. I'm trying set the target of my configurations to ~/.ivy2/.credentials
but it doesn't seem to be working. Does anyone have any advice on how to fix this?
谢谢.
推荐答案
您可以将所有凭据文件放在一个公共目录中,并添加一个全局配置文件以将所有凭据文件添加到sbt中.
You can put all your credential files in a common directory, and add a global configuration file to add all of them in sbt.
〜/.sbt/0.13/credentials.sbt
~/.sbt/0.13/credentials.sbt
credentials ++= (Path.userHome / ".sbt" / "credentials")
.listFiles
.collect {
case f if f.isFile => Credentials(f)
}
.toSeq
〜/.sbt/credentials/my-nexus-repo
~/.sbt/credentials/my-nexus-repo
realm=Sonatype Nexus Repository Manager
host=mynexusrepo.com
user=username
password=password
〜/.sbt/credentials/my-artifactory-repo
~/.sbt/credentials/my-artifactory-repo
realm=Artifactory Realm
host=myartifactoryrepo.com
user=username
password=password
这篇关于带有SBT的Jenkins中的Nexus凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!