Implementation of JENKINS-14155

Implementation of JENKINS-14155, but it will take effect only if maxtags is defined to value 1.