How to access a secured Nexus with sbt?

前端 未结 6 977
暗喜
暗喜 2020-11-27 12:37

I\'m trying to access a Nexus repository manager which requires some basic authentication. Everything works fine from Maven2 but when I try to configure things in SBT it can

6条回答
  •  误落风尘
    2020-11-27 13:25

    This worked for me. I'm using SBT version 0.13.15:

    ~/.ivy2/.my-credentials (host without port):

    realm=Sonatype Nexus Repository Manager
    host=mynexus.mycompany.com
    user=my_user
    password=my_password
    

    build.sbt (nexus url with port):

    import sbt.Credentials
    
    ...
    
    credentials += Credentials(Path.userHome / ".ivy2" / ".my-credentials")
    
    ...
    
    resolvers in ThisBuild ++= Seq(
        MavenRepository("my-company-nexus", "https://mynexus.mycompany.com:8081/repository/maven-releases/")
    )
    

提交回复
热议问题