2016-11-11 102 views
1

我有一组与日食制成的插件,我使用maven编译它们放在一起的。行家下载Eclipse,XTEXT,XTEND插件的Maven的Eclipse +:如何禁用获取所有版本

的所有最新版本的一个很短的日志以下

[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) 
:最终版本的作品,但是,我做了$ MVN当安装$有一个恼人的问题

基本上,这使得构建非常慢....

有兴趣的主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> 

你知道我怎么可以修改它,加快进程?

谢谢!

S.

+0

您是否考虑过使用特定于版本的回收站而不是复合回收站。使用像p2browser这样的工具或手动跟随compositeContent.xml | jar文件 –

回答

0

作为快速暗示:

Maven的支持-o--offline选项在此情况下仅使用本地缓存的伪像。你可以使用它来更快的本地构建。您的集成构建可以(也应该)仍然使用实际的联机p2存储库。

如果你想更普遍地解决了加载时间,以及,我看到两个选项:

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

  2. 你可以建立自己的P2存储库包含你需要的东西和存储这个在本地服务器上的Maven来使用。 b3聚合器(https://www.eclipse.org/b3/)是聚合和构建一致的自定义p2更新站点的好工具。

+2

除了Stefan Winklers的回答,您应该检查.m2文件夹中的settings.xml。在那里你可以找到''。 看来,这有价值“永远”的默认原因,这个值是每天... – Naxos84

相关问题