rm -rf $HUDSON_HOME/plugins/analysis-core*

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

cd $HUDSON_HOME
java -jar jenkins.war

rm -rf $HUDSON_HOME/plugins/analysis-core*

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

cp -f target/analysis-core.hpi $HUDSON_HOME/plugins/

cd $HUDSON_HOME
java -jar jenkins.war

Upgrade of shell script and class path.
Upgrade of shell script and class path.