Maven Repository Update Script

This script is located at Kplab server. What it does is:

  • Update a Subversion trunk snapshot
  • Build it to get dependencies
  • Copy the (possibly) new dependencies and packages to maven repository

The script is ran once a day as a cron script.


#!/bin/bash ################################## # # # Maven repository update script # # # # Mikko Wuokko - 15.06.2007 # # mikko.wuokko@evtek.fi # # # # This script MUST be ran as # # root or sudo # # # ################################## MAVEN_HOME="/opt/maven" MAVEN_SETTINGS="/var/kplab/settings.xml" MAVEN_LOCAL_REPO="/var/kplab/repository" SRC_HOME="/var/kplab/trunk" BUILD_USER="maven" REPOSITORY_USER="apache" REPOSITORY_GROUP="apache" SVN_USER="reader" SVN_PASS="reader" REPOSITORY_HOME="/var/www/html/maven2" # Remove the old local (user) repository su - ${BUILD_USER} -c "rm -Rf ${MAVEN_LOCAL_REPO}/*" # Update the sources su - ${BUILD_USER} -c "cd ${SRC_HOME} && svn update --username ${SVN_USER} --password ${SVN_PASS}" # Build the sources and install them to local (user) repository su - ${BUILD_USER} -c "cd ${SRC_HOME} && ${MAVEN_HOME}/bin/mvn clean -s ${MAVEN_SETTINGS} && ${MAVEN_HOME}/bin/mvn -s ${MAVEN_SETTINGS}" # Copy the new jars and poms to Maven repository cp -R ${MAVEN_LOCAL_REPO}/* ${REPOSITORY_HOME} # Create checksum files makeChecksums.sh ${REPOSITORY_HOME} # Add group write bits chmod -R g+w ${REPOSITORY_HOME} # Chown the files chown -R ${REPOSITORY_USER}:${REPOSITORY_GROUP} ${REPOSITORY_HOME} # Ready echo Done!


Development Development tools

  Page Info My Prefs Log in
This page (revision-2) last changed on 18:24 25-Mar-2017 by Mikko Wuokko.
 

Referenced by
...nobody

JSPWiki v2.4.102
[RSS]