0

I have following maven config. How can I translate it to sbt 1.x ? I attempted with adding credential in ~/.sbt/1.0/plugins/credentials.sbt file and it failed. How can I correctly translate it to 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>
addy
  • 103
  • 3
  • 12
  • Possible duplicate of [How to access a secured Nexus with sbt?](https://stackoverflow.com/questions/4348805/how-to-access-a-secured-nexus-with-sbt) – stefanobaghino Jan 16 '18 at 12:07
  • Not really. As this question requires translation maven pom.xml with sbt 1.x – addy Jan 16 '18 at 12:52

1 Answers1

1

It's not a plugin but something that mixes into your build. So that information, if you want to have it globally available, should be in ~/.sbt/1.0/credentials.sbt (not inside a plugins subdirectory):

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

Then in your build.sbt:

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

See also: http://www.scala-sbt.org/1.x/docs/Publishing.html

0__
  • 66,707
  • 21
  • 171
  • 266