Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes



2 answers

Permanent link
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

0 votes


Permanent link
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?

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Jul 28 '11, 10:30 a.m.

Question was seen: 3,992 times

Last updated: Jul 28 '11, 10:30 a.m.

Confirmation Cancel Confirm