rm -rf $HUDSON_HOME/plugins/tasks*

mvn install
cp -f target/*.hpi $HUDSON_HOME/plugins/

cd $HUDSON_HOME
java -jar jenkins.war

rm -rf $HUDSON_HOME/plugins/tasks*

mvn install || { echo "Build failed"; exit 1; }

cp -f target/*.hpi $HUDSON_HOME/plugins/

cd $HUDSON_HOME
java -jar jenkins.war

Update of launcher shell script.
Update of launcher shell script.