jenkinsci / java-client-api

A Jenkins API client for Java
MIT License
896 stars 468 forks source link

The addStringParam method of Class JobConfiguration is invalid #456

Open lovi-cn opened 4 years ago

lovi-cn commented 4 years ago

The error occurred on line 46: List<Node> propertiesNode = doc.selectNodes("//project/properties"); It won't get any nodes,because of the parameter:

//project/properties

Shouldn't it be "//properties" ?

vikas981 commented 3 years ago
    public static ArrayList<String> getComputerDeatail(String jenkinsUrl, String userName, String passWord) {
    ArrayList<String> arrayList = new ArrayList();
    try {
        JenkinsServer jenkinsServer = new JenkinsServer(new URI(jenkinsUrl),userName,passWord);
        Iterator<String> iterator = jenkinsServer.getComputers().keySet().iterator();
        while (iterator.hasNext())
            arrayList.add(iterator.next());
    } catch (URISyntaxException|IOException uRISyntaxException) {
        uRISyntaxException.printStackTrace();
    }
    return arrayList;
}