Command line parameters are not being read in the uploadArchives task

Hello

I’m trying to pass an argument from command line into the uploadArchives task to upload artifacts into nexus. The issue is the pom groupid is not able to resolve the command line argument properly. I’m using the following command to run
gradle -Penvironment=dcdev4_106 -Pupload -PuserName=xxx -Ppassword=xxxx uploadArchives

 uploadArchives
 {
repositories 
{
mavenDeployer {
configuration = configurations.archives

    repository(url: "http://repo.xxx.net/nexus/content/repositories/maven-internal-snapshot/"){
	  if (project.hasProperty('upload')) {
	   authentication(userName: "${userName}", password: "${password}")
	  }
	}
    addFilter('artifact1') {artifact, file ->
        artifact.name == 'artifact1'
    }
	addFilter('artifact2') {artifact, file ->
        artifact.name == 'artifact2'
    }

    println "**** Inside uploading archives for ${environment}"

    pom('artifact1').version = '1.0-SNAPSHOT'

//pom(‘artifact1’).artifactId = '1.0-SNAPSHOT’
pom(‘artifact1’).groupId = 'com.ngs.dcd.${environment}'
I get an error at this line pom(‘artifact1’).groupId = ‘com.ngs.dcd.${environment}’ where $environment argument is not being resolved. I also see it doesn’t throw any error and it is printing fine in the above print statement. The issue is only when passing in pom groupid. Not sure if the arguments cannot be passed into the pom properties or is there any special syntax with this

Thanks
Hemanth

Hi Hemanth,

I saw that you opened the same issue yesterday. Please don’t raise an issue multiple times in the forum. We’ll try to address your issue as soon as we can get around to it.

Thanks,

Ben

Sorry for that. I thought my earlier post has been not been properly posted as i didnt see it in the New topics though i can see that under my activity.

After making few trails on using appropriate syntax for this, i finally got it working with the following syntax.

pom(‘artifact1’).groupId = ‘com.ngs.dcd’ + ‘.’ +project.getProperties().environment