2012-08-06 67 views
5

我將Eclipse RCP產品的構建從PDE-build切換到Maven Tycho。除了主要的(品牌)啓動器可執行文件外,產品現在還包含「eclipsec.exe」文件。我們想從我們的產品中省略這種基於控制檯的啓動器,因爲它可能會讓我們的客戶感到困惑。有沒有辦法與Tycho做到這一點?Maven Tycho:如何在產品構建中排除eclipsec.exe?

回答

11

我上了tycho-users list這樣的回答:

在Eclipse的倉庫項目,假設你有一個。產品的文件,您可以將其他文件中被稱爲.p2.inf

相同的目錄爲了您的p2.inf文件的內容,你可以把一個P2接觸點來刪除該文件:

instructions.configure=org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/eclipsec.exe);

1

我不知道如何直接用tycho解決,但你可以用maven-antrun-plugin來實現。在適時的位置上刪除eclipsec.exe有一些小技巧。 您必須在物化和p2-director-plugin的存檔目標之間進行刪除步驟。我將刪除步驟放在階段預集成測試上,並將歸檔步驟移至階段集成測試。

<plugin> 
     <artifactId>maven-antrun-plugin</artifactId> 
     <executions> 
      <execution> 
      <id>delete-eclipsec.exe</id> 
      <phase>pre-integration-test</phase> 
      <configuration> 
       <target> 
       <delete file="${project.build.directory}/products/<<your.product.id>>/win32/win32/x86/eclipsec.exe"/> 
       </target> 
      </configuration> 
      <goals> 
       <goal>run</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <groupId>org.eclipse.tycho</groupId> 
     <artifactId>tycho-p2-director-plugin</artifactId> 
     <version>${tycho-version}</version> 
     <executions> 
      <execution> 
      <id>materialize-products</id> 
      <goals> 
       <goal>materialize-products</goal> 
      </goals> 
      </execution> 
      <execution> 
      <id>archive-products</id> 
      <phase>integration-test</phase> 
      <goals> 
       <goal>archive-products</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 

結果:在product.zip沒有eclipsec.exe。
希望有所幫助。

+0

好主意!當然,構建現在需要調用「mvn integration-test」而不是「mvn package」。儘管我仍然需要這樣做,因爲插件測試也必須與集成測試階段綁定。但是我最終使用了郵件列表中建議的p2.inf文件。太糟糕了,我不能接受這兩個答案! – 2012-08-07 15:07:38

相關問題