Java Maven+;Eclipse:如何禁用所有版本的获取

Java Maven+;Eclipse:如何禁用所有版本的获取,java,eclipse,maven,eclipse-plugin,eclipse-rcp,Java,Eclipse,Maven,Eclipse Plugin,Eclipse Rcp,我有一套用eclipse制作的插件,我正在使用maven一起编译它们。但是,最终的构建工作正常,在执行$mvn install$:maven下载所有最新版本的eclipse、xtext、xtend插件时,我遇到了一个恼人的问题 下面是一个很短的日志 [INFO] Adding repository http://download.eclipse.org/releases/mars [INFO] Fetching p2.index from http://download.eclipse.org/

我有一套用eclipse制作的插件,我正在使用maven一起编译它们。但是,最终的构建工作正常,在执行$mvn install$:maven下载所有最新版本的eclipse、xtext、xtend插件时,我遇到了一个恼人的问题

下面是一个很短的日志

[INFO] Adding repository http://download.eclipse.org/releases/mars [INFO] Fetching p2.index from http://download.eclipse.org/technology/epp/packages/mars/ (0B at 0B/s) 
[INFO] Fetching p2.index from http://download.eclipse.org/releases/mars/201506241002/ (0B at 0B/s) 
[INFO] Fetching p2.index from http://download.eclipse.org/releases/mars/201510021000/ (0B at 0B/s) 
[INFO] Fetching p2.index from http://download.eclipse.org/releases/mars/201602261000/ (0B at 0B/s)
基本上,这使得构建非常缓慢

感兴趣的主pom部分设置如下

<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <tycho-version>0.23.0</tycho-version>
        <eclipse-repository>http://download.eclipse.org/releases/mars</eclipse-repository>
        <xtext-repository>http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases</xtext-repository>
        <orcc-repository>http://www.turnus.co/addons/orcc/</orcc-repository>
    </properties>

    <repositories>
        <repository>
            <id>mars</id>
            <layout>p2</layout>
            <url>${eclipse-repository}</url>
        </repository>
        <repository>
            <id>orcc</id>
            <layout>p2</layout>
            <url>${orcc-repository}</url>
        </repository>
        <repository>
            <id>xtext</id>
            <layout>p2</layout>
            <url>${xtext-repository}</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho-version}</version>
                <extensions>true</extensions>
                <configuration>
                    <pomDependencies>consider</pomDependencies>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>target-platform-configuration</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <environments>
                        <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86</arch>
                        </environment>
                        <environment>
                            <os>linux</os>
                            <ws>gtk</ws>
                            <arch>x86_64</arch>
                        </environment>
                        <environment>
                            <os>macosx</os>
                            <ws>cocoa</ws>
                            <arch>x86_64</arch>
                        </environment>
                    </environments>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${basedir}/src-gen</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- clean output directories -->
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.5</version>
                <executions>
                    <execution>
                        <id>auto-clean</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                        <configuration>
                            <filesets>
                                <fileset>
                                    <directory>${basedir}/src-gen</directory>
                                    <includes>
                                        <include>**</include>
                                    </includes>
                                </fileset>
                                <fileset>
                                    <directory>${project.build.directory}</directory>
                                    <includes>
                                        <include>**</include>
                                    </includes>
                                </fileset>
                            </filesets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

UTF-8
0.23.0
http://download.eclipse.org/releases/mars
http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases
http://www.turnus.co/addons/orcc/
火星
p2
${eclipse存储库}
奥克
p2
${orcc存储库}
xtext
p2
${xtext存储库}
朱尼特
朱尼特
3.8.1
测试
org.apache.maven.plugins
maven编译器插件
3.3
1.7
1.7
org.eclipse.tycho
tycho maven插件
${tycho版本}
真的
考虑
org.eclipse.tycho
目标平台配置
${tycho版本}
win32
win32
x86
linux
gtk
x86_64
马科斯
热可可
x86_64
org.codehaus.mojo
构建助手maven插件
1.6
添加源
生成源
添加源
${basedir}/src gen
maven清洁插件
2.5
自动清洗
清洁的
清洁的
${basedir}/src gen
**
${project.build.directory}
**
你知道我如何修改它并加快进程吗

谢谢

作为一个快速提示:

Maven支持
-o
-offline
选项,在这种情况下,它只使用本地缓存的工件。您可以使用它进行更快的本地构建。您的集成构建仍然可以(而且应该)使用实际的在线p2存储库

如果您想更全面地解决加载时间问题,我将看到两个选项:

  • http://download.eclipse.org/technology/epp/packages/mars/
    repository是一个复合存储库。这意味着它只包含一堆指向其他p2存储库的指针。这就是它联系并下载所有其他
    http://download.eclipse.org/releases/mars/${timestamp}/
    存储库。如果你知道你只想要最新的火星版本,你可以尝试直接添加
    http://download.eclipse.org/releases/mars/201602261000/
    而不是复合存储库

  • 您可以构建自己的p2存储库,其中完全包含您需要的内容,并将其存储在本地服务器上,以便maven使用。b3聚合器()是聚合和构建一致的自定义p2更新站点的好工具

  • 作为一个简短的提示:

    Maven支持
    -o
    -offline
    选项,在这种情况下,它只使用本地缓存的工件。您可以使用它进行更快的本地构建。您的集成构建仍然可以(而且应该)使用实际的在线p2存储库

    如果您想更全面地解决加载时间问题,我将看到两个选项:

  • http://download.eclipse.org/technology/epp/packages/mars/
    repository是一个复合存储库。这意味着它只包含一堆指向其他p2存储库的指针。这就是它联系并下载所有其他
    http://download.eclipse.org/releases/mars/${timestamp}/
    存储库。如果你知道你只想要最新的火星版本,你可以尝试直接添加
    http://download.eclipse.org/releases/mars/201602261000/
    而不是复合存储库

  • 您可以构建自己的p2存储库,其中完全包含您需要的内容,并将其存储在本地服务器上,以便maven使用。b3聚合器()是聚合和构建一致的自定义p2更新站点的好工具


  • 除了Stefan Winklers