No private key authentication for ivy publish

not-a-bug

(Liam Fisk) #1

The ‘ivy-publish’ plugin does not allow private key authentication, unlike the ‘maven-publish’ plugin. This prevents people from using gradle in organizations where ivy is used on a server without password authentication.

Gradle Version: 2.x, 3.x
Operating System: any


(Mark Vieira) #2

You should be able to configure two-way SSL authentication with either Ivy or Maven. There’s no DSL for this (as there is for username/password auth) you just have to configure the build JVM with an appropriate keystore.

Update: I think you are conflating ‘maven-publish’ plugin with the ‘maven’ plugin which does provide a DSL for configuring a private key. However, you should be able to get the same result using ‘ivy-publish’ and ‘maven-publish’ via the regular Java SSL mechanisms mentioned in the link above.


(Liam Fisk) #3

It’d be great to have some documentation showing how to do that (for the gradle-noobs like me). I’ll see how I go with that link, and try produce a minimal example.


(Mark Vieira) #4

There’s nothing really Gradle specific here, this is all general Java SSL stuff, which admittedly, is a bit nebulous. Here’s a SO answer that might help you get going. Step two in the answer can be omitted if your repository is using a trusted certificate.


(Liam Fisk) #5

Sorry, I was less than clear.
The situation is that we have an Ivy server that I need to publish to, using the Ivy SFTP resolver, but there doesn’t seem to be an auth/credentials combination that allows the SSH username and private key to be specified…


(Mark Vieira) #6

Ah yes, you are correct there. The private key solution I mentioned above is HTTPS only.