【问题标题】:How to specify credentials for repository with sbt from maven?如何使用来自 maven 的 sbt 指定存储库的凭据?
【发布时间】:2018-06-25 03:00:06
【问题描述】:

我有以下 Maven 配置。 我怎样才能把它翻译成 sbt 1.x ? 我尝试在 ~/.sbt/1.0/plugins/credentials.sbt 文件中添加凭据,但失败了。 我怎样才能正确地将它翻译成 sbt ?

~/.m2/settings.xml

<servers>
<server>
    <id>PLATFORM_REPO</id>
    <username>myuser</username>
    <password>mypass</password>
</server>
</servers>

pom.xml

<repositories>
<repository>
    <releases>
        <enabled>true</enabled>
    </releases>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
    <id>PLATFORM_REPO</id>
    <name>Platform Repository</name>
    <url>https://my.platform.com/artifactory/myrepo</url>
</repository>
</repositories>

【问题讨论】:

标签: scala maven sbt


【解决方案1】:

它不是一个插件,而是混入你的构建中的东西。因此,如果您想让它在全球范围内可用,则该信息应位于 ~/.sbt/1.0/credentials.sbt 中(而不是在 plugins 子目录中):

credentials += Credentials("Platform Repository", 
  "my.platform.com/artifactory/myrepo", "myuser", "mypass")

然后在你的build.sbt:

publishTo := Some("Platform Repository" at 
  "https://my.platform.com/artifactory/myrepo")

另请参阅:http://www.scala-sbt.org/1.x/docs/Publishing.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-22
    • 2012-02-25
    • 2011-04-15
    • 1970-01-01
    • 2011-07-12
    • 2016-12-30
    • 2011-02-04
    相关资源
    最近更新 更多