Sbt publishing to repository

If you run a maven repository for your own company/projects here is how you can publish your artifacts using SBT. The repository manager I use is archiva but it should be similar for nexus etc too.

in your build.sbt file

credentials += Credentials("Repository Archiva Managed internal Repository","10.0.1.23", "admin", "somepass")
//or use a file
//credentials += Credentials(Path.userHome / ".ivy2" / ".archiva-cred")
publishMavenStyle := true
publishArtifact in Test := false
publishTo := {
  val archiva = "http://10.0.1.23:9001/repository/"
    Some("internal"  at archiva + "internal")
}

important points:

If you are using a file to store your credentials (which is the better way) here is the file format

realm=Repository Archiva Managed internal Repository
host=10.0.1.23
user=admin
password=somepassword


Metadata

145 words

Similar posts

Powered by TF-IDF/Cosine similarity

First published on 2018-05-09

Generated on Oct 9, 2024, 4:11 AM

Index

Mobile optimized version. Desktop version.