jenkinsci / java-client-api

A Jenkins API client for Java
MIT License
901 stars 470 forks source link

Getting Build from QueueReference #317

Open rgarciape opened 6 years ago

rgarciape commented 6 years ago

Hi All¡ First of all sorru for my ignorance, I´m new dealing with jenkins-api. I´m going to explain my doubt:

I have a process that call jenkins in order to launch a build:

    `   JenkinsServer jenkins = new JenkinsServer(new URI(
                "https://jenkins"), "xxxxx",
                "xxxxx");           
        Map<String, String> params = new HashedMap();
        params.put("svnPath","xxxxxx@44117");

        QueueReference queue = jenkins.getJob("JARGENERATION").build(params);`

Now I´ve to fetch the artifact and I´m trying to get it by:

                    `QueueItem item = jenkins.getQueueItem(queue);      
        BuildWithDetails build = jenkins.getBuild(item).details();`

I guest that the problem is that the build is in process, but by debugging always get NullPointer inside the API.

Some workround of how to fetch the artifact from a build recently launched?

Thanks in advance

GIfted-Jarvis commented 5 years ago

@rgarciape Have you solved it?