Grails 2.3 (2.3.7) - How to globally add a maven repository and its credentials inside the ~/.grails/settings.groovy?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Grails 2.3 (2.3.7) - How to globally add a maven repository and its credentials inside the ~/.grails/settings.groovy?

aruizca

I think this is relevant in the Grails dev forum too, because IMO the issue is a bit critical.

This is the final configuration I came up with to address this issue and be backwards compatible at the same time. Unfortunately it looks like it breaks the SNAPSHOT dependency management and it will always take the latest you have in your local repository instead of checking first your remote repository .

I have opened the following JIRA issue regarding this matter: http://jira.grails.org/browse/GRAILS-11251

grails.project.ivy.authentication = {
    repositories {
		mavenLocal()
                mavenRepo("whatever URL") {
			if (owner.grailsVersion ==~ /2\.3\..*/) {
				 auth([
					username: 'whatever',
					password: 'whatever'
				])
			}
		}
		grailsCentral()
    }

    credentials {
        realm = "Sonatype Nexus Repository Manager"
host = "whatever" username = "whatever" password = "whatever" } }
Cheers,
Angel.