2016-11-11 106 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

相關問題