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 here an adaption to Unix/Mac OS X based on bash scripts:
#!/bin/bash
#===============================================================================
# File: miror-update-sites.sh
# description: mirrors the listed update sites for eclipse to a local directory
# last change: date: $Date$
# by: $Author$
# revision: $Revision$
#-------------------------------------------------------------------------------
# settings: tab width = 4 spaces
#-------------------------------------------------------------------------------
# Copyright: Copyright Balanced Solutions, 2010-18
#===============================================================================

SCRIPT_DIR=`dirname ${0}`

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

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

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

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

# ECLIPSE_BASE=yourEclipseDir
ECLIPSE_BASE="/Volumes/Developer/eclipse-jee-4.7.2"
ECLIPSE_BIN="Eclipse.app/Contents/MacOS/eclipse -nosplash"

# EQUINOX_LAUNCHER=currentLauncherJar
EQUINOX_LAUNCHER="org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar"

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=""
#UPDATE_MANAGER_METADATA="${ECLIPSE_BASE}/${ECLIPSE_BIN} ${ECLIPSE_BASE}/plugins/${EQUINOX_LAUNCHER} -application ${UPDATE_MANAGER_METADATA_CLASS}"

MIRROR_PATH="/Volumes/Depot/Development/Eclipse/update-site-mirrors"

#=== 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"

# java ${HTTP_PROXY} ${UPDATE_MANAGER} -command mirror -from ${FROM_SITE} -mirrorUrl ${MIRROR_URL} -to ${TO_PATH}
${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://subclipse.tigris.org/update_1.10.x "subclipse"
mirror_site https://dl.bintray.com/subclipse/releases/subclipse/latest "subclipse"
mirror_site http://log4e.jayefem.de/update "log4e"
mirror_site http://update.eclemma.org "EclEmma"

#============================ E N D - O F - F I L E ============================
Please replace the values embraced by underline symbols (like _PROXY_ with the concrete occurrences at your site.

In comments you find some examples how to set the variables (for an eclipse 3.6.1) installation.
© 2010 Balanced Solutions Contact us