9

我需要在未连接到 Internet 的机器上安装 eclipse 插件,但我找不到用于本地安装的 dist。

是否有从更新站点下载插件并创建本地安装存档(或本地更新站点)的工具?谣言说你可以用 eclipse 做到这一点,但我找不到任何关于如何做到这一点的信息。

4

3 回答 3

12

您可以使用P2 镜像工具(或Galileo 文档中的 P2 镜像)来镜像远程元数据和工件存储库。

这是在本地镜像 Galileo 工件存储库的示例命令:

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/

(第一个命令镜像元数据,第二个镜像工件。命令应该在 Windows 中的一行上)

运行这些命令后,您可以file:d:/temp/galileo用作本地镜像。

或者,您可以使用P2 Mirror Ant Task,它允许您指定要镜像的可安装单元(插件或功能)。注意:指定特征时,不要忘记使用.feature.group后缀)

于 2009-08-11T07:56:47.507 回答
2

现在还支持使用 tycho 插件在 maven 中镜像 p2 站点:http ://wiki.eclipse.org/Tycho/Additional_Tools

优点之一是您可以非常精确地指定要镜像的可安装单元,针对哪个 os/ws/arch,...

例如,要镜像 Eclipse Indigo,您可以使用以下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>
于 2012-11-18T13:58:17.153 回答
0

您可能会发现构建一个定制的 Eclipse 包很有帮助,尽管它可能比您需要的要重一些。

于 2009-08-11T07:13:56.203 回答