views:

780

answers:

3

A plug-in that I want to install provides an update site for installation. However, the Eclipse installation that I want to install it to is on a machine that is not connected to the Internet. Is there a way for me to access the site (HTTP, FTP, etc.) to download the files in it for offline installation?

+1  A: 

Most Eclipse plug-ins can be installed without the Eclipse updater, by copying the required JARs available at the update site, into the plugins and features directories of the Eclipse installation.

In certain cases, it is necessary to start Eclipse with a -clean switch.

Here's an example of how to do this for the m2eclipse plugin:

  1. The m2eclipse update site is http://m2eclipse.sonatype.org/update. Identifying the list of JARs required is the first step. This is normally found in the site.xml file; in this case, you'll find it in http://m2eclipse.sonatype.org/update/site.xml.
  2. Filter the list of JARs to be downloaded to the version of the plugin that you intend to use. This can be determined by the version attribute for each "feature". If you are lucky, you'll find the description of the JAR in the category node.
  3. Note the url attribute of each JAR that needs to be downloaded. This will include the subdirectory on the server where the JAR is available, and also the directory in the Eclipse installation where they need to be placed.

PS: This method is a bit hackish, but it is based off the site-map reference. But do refer to the update

Update

I haven't attempted this, but you can create a local mirror site, from where everyone else can pickup the Eclipse plug-ins. In Galileo, this can be done by running the Eclipse updater in the standalone mode via the mirror command.

Vineet Reynolds
Tried your first suggestion. Was able to find and download the JARs but they seem to contain nothing. Installed them in the "dropins" directory and restarted but nothing happened too. Will try your other suggestion. BTW, the plug-in I'm trying to install is Mylyn's Generic Web Templates Connector from http://download.eclipse.org/tools/mylyn/update/incubator/.
Chry Cheng
For the first suggestion, I attempted downloading http://download.eclipse.org/tools/mylyn/update/incubator/features/org.eclipse.mylyn.sandbox.ui_feature_3.2.1.v20090722-0200-e3x.jar. Had no problems downloading it.
Vineet Reynolds
Looking back at it, update URL was http://download.eclipse.org/tools/mylyn/update/incubator and the file mentioned in site.xml was features/org.eclipse.mylyn.sandbox.ui_feature_3.2.1.v20090722-0200-e3x.jar. The effective URL for the JAR is therefore http://download.eclipse.org/tools/mylyn/update/incubator/features/org.eclipse.mylyn.sandbox.ui_feature_3.2.1.v20090722-0200-e3x.jar
Vineet Reynolds
Getting the features won't help. You need the plugins. I suggest trying the Eclipse Updater to create a mirror of the site. Once you do, just package it in a zip and use the zip as an update site from the update manager.
zvikico
The same plugins are anyway available from the Mylyn download page as a zip @http://www.eclipse.org/downloads/download.php?file=/tools/mylyn/update/mylyn-3.2.1-incubator.zip. That should be easiest way for the OP to distribute the plugins locally.
Vineet Reynolds
+1  A: 

You can mirror p2 site using ant task:

<target name="springide">
    <echo>springide</echo> 
    <p2.mirror verbose="true">
  <repository location="${REPO_HOME}/springide" name="springide" append="true"/>
  <source>
   <repository location="http://springide.org/updatesite" />
  </source>
  <iu id="Core / Spring IDE" version="" />
  <iu id="Extensions / Spring IDE" version="" />
  <iu id="Integrations / Spring IDE" version="" />
  <iu id="Resources / Spring IDE" version="" />
 </p2.mirror>
</target>

or findbugs:

<target name="findbugs">

<echo>findbugs</echo>
    <p2.mirror verbose="true">
  <repository location="${REPO_HOME}/findbugs" name="findbugs" append="true"/>
  <source>
   <repository location="http://findbugs.cs.umd.edu/eclipse/" />
  </source>
  <iu id="edu.umd.cs.findbugs.plugin.eclipse.feature.group" version="" />
 </p2.mirror>
</target>

In order for this to work you have to run ant tasks in the same JVM as eclipse.

You can find IU ids by opening "software updates" and copy it from there. In eclipse 3.5 there should be a More... button, in 3.4 you have to click on properties button.

ILX
+1  A: 

Eclipse offers a way of mirroring these sites automatically, either through the command line or through ant tasks.

Mirror based on site.xml information

java -jar $eclipse_home/plugins/org.eclipse.equinox.launcher_*.jar -application org.eclipse.update.core.standaloneUpdate -command mirror -from $from -to $to

Reference: Running the update manager from the command line

Mirror based on p2 information

$eclipse_home/eclipse -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source $1 -destination $2
$eclipse_home/eclipse -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -source $1 -destination $2

Reference: Equinox p2 repository mirroring

You can follow the evolution of these scripts in my script repository.

Robert Munteanu