It's all about the answers!

Ask a question

Variables declared as Hidden cannot be sent as parameter


Ankit Kothari (1361616) | asked Jul 28 '11, 10:30 a.m.
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

2 answers



permanent link
Brent Ulbricht (2.5k11) | answered Jul 28 '11, 2:12 p.m.
JAZZ DEVELOPER
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

permanent link
Ankit Kothari (1361616) | answered Jul 28 '11, 4:21 p.m.
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?

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.