2013-08-21 12 views
4

如何添加前缀目录,以便在解压包含我的RCP应用程序的zip文件时获取包含内容的目录?如何获得tycho materialize-product和archive-product为我的RCP应用程序归档文件使用目录前缀

当tycho maitableizes和存档我的rcp应用程序时,它会将目录/ products/my.rcp.app/linux/gtk/x86_64 /内容压缩而不需要目录前缀。

当前ZIP内容:

  • ./features
  • ./plugins
  • ...

期望拉链内容:

    要创建
  • ./myapp/features
  • ./myapp/plugins
  • ...

当用户解压的zip,我想app目录。我浏览了tycho文档,但既没有存档也没有实现,似乎没有正确的配置。我总是可以使用antrun或assembly插件来完成这项工作,但这并不是解决问题的正确方法。

请让我知道如何添加前缀目录。

回答

6

该配置真的有点搞砸了,而不是真的documented。由于您(当前)可以在一个eclipse-repository模块中包含多个产品文件,因此您需要选择要应用其配置的产品ID。

因此,为了与ID product.id设置存档根文件夹的产品,你需要以下配置:

<build> 
    <plugins> 
    <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> 
      <goals> 
       <goal>archive-products</goal> 
      </goals> 
     </execution> 
     </executions> 
     <configuration> 
     <products> 
      <product> 
      <id>product.id</id> 
      <rootFolder>myapp</rootFolder> 
      </product> 
     </products> 
     </configuration> 
    </plugin> 
    </plugins> 
</build> 
0

谢谢,但我需要使用rootFolder选项添加额外的目录。我试图在.product文件中注入achivePrefix,但没有奏效。我终于分解了,抓住了tycho源并向后找到rootFolder。在这次旅程之后,我在文档中看到了它,并打乱了它的意思。

文件:http://wiki.eclipse.org/Tycho/Packaging_Types#Creating_Product_Zip_Files

相关:https://issues.sonatype.org/browse/TYCHO-507

 <plugins> 
     <plugin> 
      <groupId>org.eclipse.tycho</groupId> 
      <artifactId>tycho-p2-director-plugin</artifactId> 
      <version>${tycho-version}</version> 
      <configuration> 
      <products> 
       <product> 
     <id>match-product-uid-field-from-foo.product-file</id> 
     <rootFolder>workbench</rootFolder> 
       </product> 
      </products> 
      </configuration> 
      <executions> 
       <execution> 
        <!-- install the product using the p2 director --> 
        <id>materialize-products</id> 
        <goals> 
         <goal>materialize-products</goal> 
        </goals> 
       </execution> 
       <execution> 
        <!-- create zip file with the installed product --> 
        <id>archive-products</id> 
        <goals> 
         <goal>archive-products</goal> 
        </goals> 
        <configuration> 
         <formats> 
          <linux>tar.gz</linux> 
          <win32>zip</win32> 
         </formats>       
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
+1

您的意见很有意思,但只是看着,我想知道这是我的回答不同的实际答案的一部分? – oberlies

+0

哎呀,它是一样的。我误读了 –

相关问题