How to mirror eclipse update sites….

[This short page is based on a publication which can be found at deNoo's Blog

When updating multiple eclipse installations in a local network it comes handy if you have a local mirror of the update sites that your developer's are interested in. The originally described method by 'deNoo' was focused on Windows. Please find below an adaption to Unix/Mac OS X based on bash scripts. To make it working for you. Configure the variables MIRROR_PATH, ECLIPSE_BASE, EQUINOX_LAUNCHER and HTTP_PROXY considering your local setup.

#!/bin/bash
#===============================================================================
# File:         miror-update-sites.sh
# description:  mirrors the listed update sites for eclipse to a local directory
#-------------------------------------------------------------------------------
# settings:     tab width = 4 spaces
#-------------------------------------------------------------------------------
# Copyright:    Copyright Balanced Solutions, 2010-19
#===============================================================================

SCRIPT_DIR=`dirname ${0}`

#====== Settings ===============================================================

#------ Local Mirror -----------------------------------------------------------

MIRROR_PATH="update-site-mirrors"

#------ HTTP -------------------------------------------------------------------

# HTTP_PROXY="-Dhttp.proxyHost=yourProxy -Dhttp.proxyPort=yourProxyPort"
HTTP_PROXY=

#------ UPDATE MANAGER ---------------------------------------------------------

ECLIPSE_BASE="eclipse-jee-2018-09"
ECLIPSE_BIN="Eclipse.app/Contents/MacOS/eclipse -nosplash"

EQUINOX_LAUNCHER="org.eclipse.equinox.launcher_1.5.100.v20180827-1352"

UPDATE_MANAGER_ARTIFACTS_CLASS="org.eclipse.equinox.p2.artifact.repository.mirrorApplication"
UPDATE_MANAGER_METADATA_CLASS="org.eclipse.equinox.p2.metadata.repository.mirrorApplication"
UPDATA_MANAGER_ARGUMENTS=""

#=== function to mirror a site =================================================

function mirror_site() {

  local FROM_SITE=$1
  local MIRROR_URL="http://server/eclipse-update-site-mirrors/$2"
  local TO_PATH="${MIRROR_PATH}/$2"

  ${ECLIPSE_BASE}/${ECLIPSE_BIN} -application ${UPDATE_MANAGER_ARTIFACTS_CLASS} ${UPDATA_MANAGER_ARGUMENTS} -source ${FROM_SITE} -destination ${TO_PATH}
  ${ECLIPSE_BASE}/${ECLIPSE_BIN} -application ${UPDATE_MANAGER_METADATA_CLASS}  ${UPDATA_MANAGER_ARGUMENTS} -source ${FROM_SITE} -destination ${TO_PATH}
}

#=== 'main' ====================================================================

mirror_site http://log4e.jayefem.de/update "log4e"

#============================ E N D - O F - F I L E ============================
© 2018 Balanced Solutions Contact us