I'm unable to duplicate the problem you're reporting, either with a freestyle job, nor with a pipeline job. The environment I'm using to duplicate the problem can be reconstructed with the following steps:
- Clone, build, and run the docker instance
$ git clone https: $ cd JENKINS-41906
$ git checkout -b lts-with-plugins 43617aecbb2ad5250460bdbf2c5d3b6fbdc37e94
$ docker build -t jenkins:JENKINS-41906 .
$ # Copy jdk8 from Oracle to ~/public_html/jdk/jdk-8u121-linux-x64.tar.gz
$ # Copy ant-1.9.8 from Apache to ~/public_html/ant/apache-ant-1.9.8-bin.zip
$ docker run -i --rm \
--publish 8080:8080 \
--volume ~/public_html/:/var/jenkins_home/userContent/ \
jenkins:JENKINS-41906
- Connect a web browser to that docker instance (http://localhost:8080)
- Open the "Bugs - Individual Checks" folder
- Open the "JENKINS-41906-master-branch-builds-without-change" job
- Click "Poll now" (simulate the web hook), confirm that the job builds (because it has not been built before)
- Click "Poll now" (simulate the web hook again), confirm that the job does not build (already built)
I also checked it with a pipeline job in that same Docker instance. You can see the behavior in the pipeline job with the following steps:
- Open the "Bugs - Pipeline Checks" folder
- Open the "jenkins-bugs" pipeline job
- Click the "Scan Multibranch Pipeline" link and "Run Now" to index branches for that repository
- Confirm that a job is created and built for the "master" branch and all other branches
- Wait 10-15 minutes, then Click the "Scan Multibranch Pipeline" link and "Run Now" to index branches again for that repository. That will likely detect changes on one of the branches, since I usually have tests running somewhere that will commit to that repository
- Confirm that the job named "master" did not rebuild, even though other jobs rebuilt due to changes in them
Can you provide more details of the steps to duplicate the problem you're seeing?
Are you using a freestyle job, a multi-configuration job, a pipeline job, a multi-branch pipeline job, or some other type of job?
Are there other details of your environment which I missed in my attempt to duplicate the problem?
If the master branch is being built repeatedly even though there is no change in it, that is a bug. Please provide step by step instructions to duplicate that bug.