Variables declared as Hidden cannot be sent as parameter
Hi,
I have 2 environment variables, USERNAME and PASSWORD, which would be used in my Build File. Variable "PASSWORD" is hidden.
I am trying to invoke an ANT build file from Build Forge. But, I want to use username and password inside the ANT file. But, at the same time, I do not want to disclose the password.
I invoke the build file like this: <Something> build.xml
-Dpassword=${PASSWORD} -Dusername=${USERNAME}
But, since the field "PASSWORD" is declared as hidden, build forge does not pass the value of the PASSWORD.
Please let me know how I can achieve this.
Thanks
Ankit
I have 2 environment variables, USERNAME and PASSWORD, which would be used in my Build File. Variable "PASSWORD" is hidden.
I am trying to invoke an ANT build file from Build Forge. But, I want to use username and password inside the ANT file. But, at the same time, I do not want to disclose the password.
I invoke the build file like this: <Something> build.xml
-Dpassword=${PASSWORD} -Dusername=${USERNAME}
But, since the field "PASSWORD" is declared as hidden, build forge does not pass the value of the PASSWORD.
Please let me know how I can achieve this.
Thanks
Ankit
2 answers
Hi,
I have 2 environment variables, USERNAME and PASSWORD, which would be used in my Build File. Variable "PASSWORD" is hidden.
I am trying to invoke an ANT build file from Build Forge. But, I want to use username and password inside the ANT file. But, at the same time, I do not want to disclose the password.
I invoke the build file like this: <Something> build.xml
-Dpassword=${PASSWORD} -Dusername=${USERNAME}
But, since the field "PASSWORD" is declared as hidden, build forge does not pass the value of the PASSWORD.
Please let me know how I can achieve this.
Thanks
Ankit
Hi,
I would recommend to not use the -D properties to pass the variables, but rather use the Ant environment inside your build xml to get at the variables. For example, you could have some code like below.
<?xml version="1.0"?>
<project default="compile" basedir=".">
<property environment="env"/>
<target name="compile">
<echo message="******* ${env.ANT_USERNAME} ********${line.separator}" file="password_test.txt" append="false"/>
<echo message="******* ${env.ANT_PASSWORD} ********${line.separator}" file="password_test.txt" append="true"/>
</target>
</project>
The ant execution would just be 'ant -f build.xml' .
Brent Ulbricht
RTC Build Lead
Hi,
I have 2 environment variables, USERNAME and PASSWORD, which would be used in my Build File. Variable "PASSWORD" is hidden.
I am trying to invoke an ANT build file from Build Forge. But, I want to use username and password inside the ANT file. But, at the same time, I do not want to disclose the password.
I invoke the build file like this: <Something> build.xml
-Dpassword=${PASSWORD} -Dusername=${USERNAME}
But, since the field "PASSWORD" is declared as hidden, build forge does not pass the value of the PASSWORD.
Please let me know how I can achieve this.
Thanks
Ankit
Hi,
I would recommend to not use the -D properties to pass the variables, but rather use the Ant environment inside your build xml to get at the variables. For example, you could have some code like below.
<xml>
<project>
<property>
<target>
<echo>
<echo>
</target>
</project>
The ant execution would just be 'ant -f build.xml' .
Brent Ulbricht
RTC Build Lead
Oh cool.. This sounds very simple.. So, it will take the environment variable declared in Build Forge?