I am using IntelliJ IDEA ultimate to import an SBT project that has some plugins in a private Artifactory.
[info] Resolving com.private#XXXX_X.X;X.X.X-SNAPSHOT ...
[error] Unable to find credentials for [Artifactory Realm @ artifactory-private.com].
[error] Unable to find credentials for [Artifactory Realm @ artifactory-private.com].
I did configure the Artifactory credentials in SBT and is working fine if I build the project using sbt shell; however, build is failing in IntelliJ and is not recognizing the credentials. Can anyone help, please?
Update: It appears that this is the only problem when the plugins are SNAPSHOT versions.
Thank you very much in advance!
In sbt 1.x, set 3 files:
~/.sbt/repositories
~/.sbt/credentials
~/.sbt/1.0/plugins/credentials.sbt
The first can contain something like this (just an example):
[repositories]
local
maven-local
my-ivy-proxy-releases1: https://<yourdomain.org>/sbt-scala/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[rev
ision]/[type]s/[artifact](-[classifier]).[ext]
my-maven-proxy-releases: https://<yourdomain.org>/maven-release/
The second something like this:
realm=Artifactory Realm
host=<yourdomain.org>
user=<your_user>
password=<your_pass>
Additionally, you create this file: ~/.sbt/1.0/plugins/credentials.sbt
credentials += Credentials(Path.userHome / ".sbt" / "credentials")
Now, in the console, in your project directory you can do something like this to compile your project using this repositories only.
sbt -Dsbt.override.build.repos
And in sbt:
VM parameters: "-Dsbt.override.build.repos"
Mark: - Use sbt shell [✓] For imports [✓] For builds
[✓] Allow overriding sbt version [✓] Enable debugging for sbt shell
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With