in m3, I was able to do something like this:

repositories {
  org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials("Sonatype 
Nexus Repository Manager", "myserver", "readonly", "password")
  mavenRepo urls: ["myserver"]
}

This allowed anyone who ran the build file to use the authenticated repo 
without having to enter any credentials.

For my publish task, I had this:

uploadArchives {
  doFirst {
    def console = System.console()
    
uploadArchives.repositories.findByName('myrepo').repository.authentication.userName
 = console.readLine('\n> Nexus Username: ')
    
uploadArchives.repositories.findByName('myrepo').repository.authentication.password
 = new String(console.readPassword('> Nexus Password: '))
  }
  uploadDescriptor = true
  repositories {
    repositories.mavenDeployer([name: 'myrepo']) {
      repository(url: 
"https://nexus.formicary.net/nexus/content/repositories/formicary-releases";) { 
authentication() }
    }
  }
}

This would then prompt the user for the write credentials to upload artifacts.

However, this no longer works in m4, and the read only credentials are used 
when trying to upload artifacts.

Any suggestions on how best to achieve this? My main requirement is that the 
user's password should never be persisted onto disk, and that downloading 
should not require the user to enter a password every time they run a build or 
download a new dep.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to