On a related note, I am having difficulty handing the username and password for 
authentication for the upload.  Directly embedding the information as you did 
here does allow me to do the upload.  However, I obviously do not want to be 
checking in the build file with that information.  I tried extracting that 
information to ~/.gradle/gradle.properties but that information is not being 
handled correctly.  I am pretty sure this is a matter of "timing" but I am not 
sure what I need to do to get it to work:

subprojects { subProject ->
    ...
    if ( ! hasProperty('MY_JBOSS_USER') ) {
        MY_JBOSS_USER = "";
    }
    if ( ! hasProperty('MY_JBOSS_PASS') ) {
        MY_JBOSS_PASS = "";
    }

    uploadArchives {
        repositories.mavenDeployer {
            ...
            credentials = [userName: MY_JBOSS_USER, password: MY_JBOSS_PASS]
            repository(url: 
"https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/";) {
                authentication(credentials)
            }
            snapshotRepository(url: 
"https://repository.jboss.org/nexus/content/repositories/snapshots";) {
                authentication(credentials)
            }
        }
    }
}

MY_JBOSS_USER and MY_JBOSS_PASS are always empty (i put printlns in to 
verify).  If I instead define that "credentials" map with my username and 
password directly it works.

Specifically it seems to be a problem with the hasProperty() checks.  If I 
remove them it actually does see the values from my gradle.properties.  Thwe 
trouble with that (and why that was added in the first place), was that when 
people try to build this project without those properties defined the build 
blows up, even if they are not try to perform uploads.

Any hints on achieving what I want here?


On Wednesday, October 06, 2010 03:08:03 pm Rene Groeschke wrote:
> ------------------
> uploadArchives {
> repositories.mavenDeployer {
> configuration = configurations.archives
> repository(url: "http://localhost:8081/nexus/content/repositories/test";) {
> authentication(userName: "admin", password: "admin123")
> }

-- 
Steve Ebersole <st...@hibernate.org>
http://hibernate.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to