Gitlab4j API: PipelineApi

I want initiate build/test from java program.,( not necessarily on code commit to current project, but based on 3rd party binary updates which are managed externally)

I am trying Pipeline b = pipeapi.createPipeline(1, “master”);
but it is failing with following error
at org.gitlab4j.api.AbstractApi.validate(
at org.gitlab4j.api.PipelineApi.createPipeline(

Even passing commit ID as second argument did not help.

I can pre-create pipeline and re-run it, even this seems to be not possible.

pipeapi.retryPipelineJob(1, 8);

org.gitlab4j.api.GitLabApiException: Created
at org.gitlab4j.api.AbstractApi.validate(
at org.gitlab4j.api.PipelineApi.retryPipelineJob(

please suggest what is wrong, also is there any other elegant approach to this ?

I found the issue, i think gitlab4j has wrong implementation for pipe creation API
i extended piecreation APIs and reimplemented as follows, this works,
This seems to be bug and needs fix from gitlab4j .

public Pipeline createPipeline(int projectid, String reference) {
	MultivaluedHashMap<String, String> map = new MultivaluedHashMap<>();
	map.add("ref", reference);

    Response response=null;
	try {
		response = post(**Response.Status.CREATED**, map, "projects", projectid, **"pipeline"**);
		return (response.readEntity(Pipeline.class));
	} catch (GitLabApiException e) {
		// TODO Auto-generated catch block
	return null;

I am the author of GitLab4J, and just noticed this post. I have also made the fix in GitLab4J (status should have been CREATED vs. OK). In the future if problems related to GitLab4J could be posted at: it will help improve the project.


Greg, Thanks a lot, for the fix and suggestion, I shall follow your suggestion.

Best Regards