It's all about the answers!

Ask a question

Using Java to copy Build Engine including the password through IBuildEngine


0
1
Timothy Tan (36) | asked Mar 20 '17, 6:39 a.m.
edited Mar 20 '17, 11:44 p.m.

I am trying to copy an existing Build Engine to be used with a new Build Definition. Making a copy does not duplicate the password used in the Build Agent Connection. How do I get the password and copy it over? I am not able to see any properties in the Build Engine via IBuildEngine.getProperties()


List<IBuildEngine> buildEngines = fetchResult.getRetrievedItems();
for (IBuildEngine buildEngine : buildEngines) {
    System.out.println("BuildEngine=" + buildEngine.getId());
    IBuildProperty[] buildEngineProperties = (IBuildProperty[]) buildEngine.getProperties().toArray();
    for (int j = 0; j < buildEngineProperties.length; j++) {
        String propName = buildEngineProperties[j].getName();
        String propValue = buildEngineProperties[j].getValue();
        System.out.println(propName + "=" + propValue);
    }
}


RTC 6.0.2, JRE 1.8

Be the first one to answer this question!


Register or to post your answer.