[JENKINS-18352] we want to prefer *.jpi over *.hpi, but the code was other way around

(cherry picked from commit 5aa4af75c2c4c66541f1fd24ef82c5d46a79940d)