Using Jenkins Client API

18 views
Skip to first unread message

Narreddi Anil Kumar Reddy

unread,
Nov 2, 2016, 1:43:49 PM11/2/16
to Jenkins Users
Hi,

I've the jenkins-client code downloaded from GIT and when I try to establish connection to Jenkins server suing the below URL,it's failing with exception and not able to connect to jenkins.Does any body have any suggestions.

                         JenkinsServer jenkinsClient = new JenkinsServer(new URI("http://10.8.2.174:8082/login?from=%2Fje"), "admin", "admin");
System.out.println("Connected to Jenkins server::::"+jenkinsClient.getVersion());

Thanks,
Anil

Victor Martinez

unread,
Nov 2, 2016, 5:16:38 PM11/2/16
to Jenkins Users
I dont know what api you use but that url doesn't look good to me.

Have you tried with the below snippet
new URI("http://10.8.2.174:8082"), "admin", "admin");

Cheers

Karl Heinz Marbaise

unread,
Nov 2, 2016, 6:17:57 PM11/2/16
to jenkins...@googlegroups.com
Hi,
First why not using the offical release from Maven Central rep (release
0.3.6) furthermore you shouldn't use the url with the login part...only
simply:

JenkinsServer jenkinsClient = new JenkinsServer ( new
URI("http://10.8.2.174:8082/"), "admin", "admin");
...

Kind regards
Karl Heinz Marbaise
Reply all
Reply to author
Forward
0 new messages