Support for Maven Repositories that use realm-based SSO

I’m trying to use the Oracle Maven Repository, but I can’t seem to authenticate. According to this post in the gradle-dev Google Group, which I used for the title of this discussion, I need to be able to specify the realm in the credentials. Is this now possible?

The instructions using the repository in a Maven build are here.

This is currently not possible. The realm used when authenticating isn’t currently configurable. The thread linked to above is discussing potential implementations to allow for this. If this is something you are interested in contributing, we can continue the discussion on the mailing list.

1 Like

If you really wanted to do this today, it wouldn’t be too difficult to create a proxy (eg servlet running in jetty) which handles the authentication / redirect before proxying the request / response between gradle and the Oracle repository.

Obviously there’s security issues which could arise from this hack

Or just switch on the Proxy/Cache feature of your own internal repository :wink:

For Nexus:

I’ve found this example of using Oracle Maven with Gradle created by Robin A Meade.

Use the following URL for Oracle Maven: “
Either add the credential directly:

credentials {
 username = '<Oracle Account email address>'
 password = '<Oracle Account password>'

Or using the “net.linguica.maven-settings” plugin to access the credentials in a Maven settings file, which could then be encrypted.