Dynamically adding a file to a product archive built by Tycho

送分小仙女□ 提交于 2020-01-04 02:20:11

问题


Adding a file to a product distribution archive built with Maven/Tycho is possible: see this link

But how can I add a dynamically chosen file to my archive? For example this could be a data file.


回答1:


The article you linked deals with removing files from a product distribution archive, which can be quite challenging. Adding files to a distribution archive is a lot simpler, and doesn't require any of the low-level p2 hacking described in the article.

In order to add a file to a product distribution archive, include add it as as root files to one of the features included in your product:

  1. In the build.properties of the feature build, add a line root=file:target/rootfiles/**
  2. Add goals in the pom.xml of the feature build so that the file(s) you want to have included in the distribution archive are copied/added to the target/rootfiles folder during the build. E.g. the maven-resources-plugin or the maven-dependency-plugin could do this.

When the feature with the root files configuration is added to the product, the files you have put into target/rootfiles will end up in the product distribution archive.

In case you have problems with this, you also may have a look at this example project.



来源:https://stackoverflow.com/questions/17566380/dynamically-adding-a-file-to-a-product-archive-built-by-tycho

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!