[JENKINS-25401] fixed regression

The regression has been introduced in https://github.com/jenkinsci/gradle-jpi-plugin/commit/f63269d9c2e243888cc9e2e680d94c2c2342b336.