构建 RCP 应用程序时在 Tycho 中进行 p2.inf 过滤 [英] p2.inf Filtering in Tycho when building an RCP application

查看:52
本文介绍了构建 RCP 应用程序时在 Tycho 中进行 p2.inf 过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 tycho 构建 RCP 应用程序.RCP 应用程序使用 p2 及其自更新功能在 p2.inf 文件中配置存储库.很有魅力.

现在我想在 p2.inf 文件中引入一个占位符 ${updatesiteurl} 并根据它的构建环境将其替换为 URL.但不幸的是,它被替换为空字符串而不是环境变量,我猜这是因为 tycho 或 p2 导演替换了一些转义字符(例如:",例如 ${58}).

有什么想法可以解决这个问题吗?我想过明确声明资源插件并将其绑定到较早的构建阶段,但这也不起作用......

解决方案

最终有效的是:我将 p2.inf 文件移动到目录/p2 并让 maven 资源插件将带有替换的文件复制到/目标.现在,复制任务将稍后阶段的文件复制到根目录,即 .product 文件所在的目录,因为两者必须在同一目录中(为什么这在同一阶段不起作用...)(具有相同的前缀).最后clean删除根目录下的p2.inf文件...

I´m building an RCP application using tycho. The RCP application uses p2 and its self updateable capabilities configuring the respository in an p2.inf file. Works like a charm.

Now I want to introduce a placeholder ${updatesiteurl} in the p2.inf file and replace it with the URL according to the environment for which it is built. But unforunately it get´s replaced with an empty string instead of the environment variable which I guess happens because tycho, or the p2 director, replaces some escaped characters (like the ":" which is ${58} for example).

Any ideas how this could be solved? I thought about explicitly declaring the resource plugin and binding it to an earlier build phase but that didn´t work either...

解决方案

What finally worked is: I moved the p2.inf file to directory /p2 and let the maven resource plugin copy the file with the replacements to a temporary folder in /target. Now a copy task copies the file in a later phase (why the hell didn´t this work in the same phase...) to the the root directory, where the .product file is, since both have to be in the same directory (with the same prefix). Finally clean deletes the p2.inf file in the root directory...

这篇关于构建 RCP 应用程序时在 Tycho 中进行 p2.inf 过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆