简体   繁体   中英

How to trigger maven specific job in Jenkins with Gerrit

I'm currently using Jenkins(1.451) and the Gerrit Trigger(2.3.1) to launch builds from Gerrit in order to verify code.

This is working fine as long as the project in Jenkins is configured as a "Free style" project. However, I'm currently setting up a new build pipeline where I'm using the "Build a maven2/3 project" option in order to take advantage of maven specific properties which I can't get from the "Free style" option. For some reason, Jenkins doesn't seem to trigger builds using this option. Nothing at all happens when I submit code to Gerrit which under normal circumstances should be picked up. I'm actually wondering if the Gerrit trigger is meant to work with Jenkins projects configured as a maven2/3 job or maybe it is the case that I can only use the Free style option in order to do this.ge

Could anyone confirm if this is the case?

Yes this will work. I suspect you might have some authentication issues that causes your jobs not to be triggered.

Check you sshd_log in the gerrit config folder to see if there are any jenkins logins that result in immediate LOGOUT. I my case I forgot to add Stream Events rights to the Non-Interactive Users under All-Projects and this caused some strange behavior.

This was the message I saw 3x per second in my sshd_log: jenkins a/1000002 gerrit.stream-events 0ms 0ms not-admin

See here for more details

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM