Tool for downloading eclipse plugins from update sites
Asked Answered
N

3

9

I need to install an eclipse plugin to a machine not connected to the Internet and I cannot find a dist to use for a local install.

Is there a tool for downloading a plugin from an update site and create a local installation archive (or a local update site)? Rumors says you can do this with eclipse, but I cant find any info on how to do it.

Nianiabi answered 10/8, 2009 at 21:19 Comment(3)
Not clear what the maven-2 connection is here. Is there some background information you've left out, or should this be tagged "eclipse"?Phraseogram
Messed up the tags, sorry for that.Nianiabi
It seems @PeterŠtibraný 's answer below does not work, at least in some cases and with Eclipse Kepler. Could you check whether this still works for you?Radbun
S
13

You can use P2 mirror tool (or P2 mirror in Galileo documentation) to mirror remote metadata and artifacts repository.

Here is sample command to mirror Galileo artifacts repository locally:

eclipse\eclipsec.exe -nosplash -verbose 
-application org.eclipse.equinox.p2.metadata.repository.mirrorApplication
-source http://download.eclipse.org/releases/galileo
-destination file:d:/temp/galileo/

eclipse\eclipsec.exe -nosplash -verbose
-application org.eclipse.equinox.p2.artifact.repository.mirrorApplication
-source http://download.eclipse.org/releases/galileo
-destination file:d:/temp/galileo/

(First command mirrors metadata, second mirrors artifacts. Command should be on one line in windows)

After you run these commands, you can use file:d:/temp/galileo as a local mirror.

Alternatively, you can use P2 Mirror Ant Task, which lets you specify installable units (plugins or features) to mirror. Note: when specifying feature, don't forget to use .feature.group suffix)

Sayyid answered 11/8, 2009 at 7:56 Comment(5)
To be honest, I am still not sure how it works exactly: whether to mirror only artifacts and let P2 Publisher generate metadata, or whether to mirror both artifacts and metadata. Please share your findings when you succeed. Thank you.Godliman
Updated answer: when I run both commands (mirror metadata, mirror repository), I got correct update site for local use. I tested with download.eclipse.org/tools/mylyn/update/weekly/e3.4Godliman
I used the mirror artifact command and used the downloaded files locally and it worked like a charm. Have not trided the ant task (yet). Thanks Peter for your help.Nianiabi
I tried doing this, and got to the point where Eclipse asks me to approve the license, but after that, it tries to go after the original files at the on-line repository - so, this doesn't work as is! @PeterŠtibraný, please help...Radbun
@einpoklum: I'm sorry, I can't help you, I don't use Eclipse anymore. Try asking new question here on SO with more details, maybe somebody can help.Godliman
P
3

Now there is also a support for p2 sites mirroring in maven using tycho plugins: http://wiki.eclipse.org/Tycho/Additional_Tools

One of the advantage is that you can very precisely specify what installable unites you want to mirror, for which os/ws/arch, ...

For instance to mirror Eclipse Indigo you can use following pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <groupId>mirroring</groupId>
    <artifactId>indigo-mirror</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <properties>
        <tycho.version>0.16.0</tycho.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.tycho</groupId>
                    <artifactId>tycho-p2-repository-plugin</artifactId>
                    <version>${tycho.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho.extras</groupId>
                <artifactId>tycho-p2-extras-plugin</artifactId>
                <version>${tycho.version}</version>
                <executions>
                    <execution>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>mirror</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <source>
                        <!-- source repositories to mirror from -->
                        <repository>
                            <url>http://ftp.sh.cvut.cz/MIRRORS/eclipse/releases/indigo/</url>
                            <layout>p2</layout>
                            <!-- supported layouts are "p2-metadata", "p2-artifacts", and "p2" (for joint repositories; default) -->
                        </repository>
                    </source>    

                    <!-- The destination directory to mirror to. -->
                    <destination>${project.build.directory}/repository</destination>
                    <!-- Whether only strict dependencies should be followed. -->
                    <!-- "strict" means perfect version match -->
                    <followStrictOnly>false</followStrictOnly>
                    <!-- Whether or not to follow optional requirements. -->
                    <includeOptional>true</includeOptional>
                    <!-- Whether or not to follow non-greedy requirements. -->
                    <includeNonGreedy>true</includeNonGreedy>
                                            <!-- include the latest version of each IU -->
                    <latestVersionOnly>false</latestVersionOnly>
                    <!-- don't mirror artifacts, only metadata -->
                    <mirrorMetadataOnly>false</mirrorMetadataOnly>
                    <!-- whether to compress the content.xml/artifacts.xml -->
                    <compress>true</compress>
                    <!-- whether to append to the target repository content -->
                    <append>true</append>
                    <!-- whether to mirror pack200 artifacts also. Available since tycho-extras 0.17.0 -->
                    <verbose>true</verbose>
                    <includePacked>true</includePacked>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
Pasture answered 18/11, 2012 at 13:58 Comment(0)
P
0

You might find Building a custom Eclipse package helpful, although it's probably a bit more heavyweight that what you need.

Puglia answered 11/8, 2009 at 7:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.