构建 eclipse 产品时 p2.inf 文件出现问题
我有一个依赖于某个功能的 Eclipse 产品。现在我希望能够更新此功能。我还希望能够使用预定义的更新站点启动应用程序。我创建了一个 p2.inf 文件,其中包含(基于: http://aniefer.blogspot.com/2009/07/composition-and-updating-custom-eclipse.html):
requires.0.name = com.application.feature.group
requires.0.range = [1.0.0.qualifier, 2.0.0.qualifier)
instructions.configure=\
addRepository(type:0,location:https${#58}//ccp.com/);\
addRepository(type:1,location:https${#58}//ccp.com/);
但是当我转到安装管理器时,更新站点 ccp.com 没有显示构建产品(如果我删除“requires”命令,它就可以正常工作)。
上面的p2.inf文件有什么问题吗?
我现在已经尝试过:
requires.0.namespace=org.eclipse.equinox.p2.iu
requires.0.name = com.application.feature.group
requires.0.range = [1.0.0.qualifier, 2.0.0.qualifier)
instructions.configure=\
addRepository(type:0,location:https${#58}//ccp.com/);\
addRepository(type:1,location:https${#58}//ccp.com/);
但是当我构建它时,我收到错误:
Cannot complete the install because one or more required items could not be found.
Software being installed:
MyProduct 1.0.0.201102161136 (com.application.product 1.0.0.201102161136) Missing requirement:
MyProduct 1.0.0.201102161136 (com.application.product 1.0.0.201102161136) requires 'com.application.feature.group [1.0.0.qualifier,2.0.0.qualifier)'
but it could not be found
Application failed, log file location: ...
我还尝试从版本范围和我的功能中的 p2.inf 文件中删除限定符,但得到相同的错误。有什么想法吗?
I have an eclipse product that depends on a feature. Now I would like to be able to update this feature. I would also like to be able to start the application with a predefined update site. I have created a p2.inf file which contains (based on: http://aniefer.blogspot.com/2009/07/composing-and-updating-custom-eclipse.html):
requires.0.name = com.application.feature.group
requires.0.range = [1.0.0.qualifier, 2.0.0.qualifier)
instructions.configure=\
addRepository(type:0,location:https${#58}//ccp.com/);\
addRepository(type:1,location:https${#58}//ccp.com/);
But the updatesite ccp.com does not shown when I go to the install manager in the build product (it works fine if I remove the 'requires' commands).
Are there anything wrong with the above p2.inf file?
I have now tried:
requires.0.namespace=org.eclipse.equinox.p2.iu
requires.0.name = com.application.feature.group
requires.0.range = [1.0.0.qualifier, 2.0.0.qualifier)
instructions.configure=\
addRepository(type:0,location:https${#58}//ccp.com/);\
addRepository(type:1,location:https${#58}//ccp.com/);
but when I build it I get the error:
Cannot complete the install because one or more required items could not be found.
Software being installed:
MyProduct 1.0.0.201102161136 (com.application.product 1.0.0.201102161136) Missing requirement:
MyProduct 1.0.0.201102161136 (com.application.product 1.0.0.201102161136) requires 'com.application.feature.group [1.0.0.qualifier,2.0.0.qualifier)'
but it could not be found
Application failed, log file location: ...
I have also tried to remove the qualifier from the p2.inf file in the version range and on my feature, but get the same error. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试添加
我怀疑不指定命名空间会将其在 p2.inf 解析器中保留为 null,最终导致
Assert.isNotNull(namespace)
或 NPE 上的断言失败。其中任何一个都可能导致整个 p2.inf 文件被忽略。Try adding
I suspect that not specifying the namespace leaves it as null in the p2.inf parser, eventually leading to an assertion failure on a
Assert.isNotNull(namespace)
, or an NPE. Either of these would probably cause the entire p2.inf file to be ignored.我发现我需要使用 p2.context.repos 选项来传递包含 p2.inf 中引用的项目的存储库。结合使用它和pluginPath 是关键。
I found that I needed to use the p2.context.repos option to pass in the repositories containing the items referred to in p2.inf. Using this and pluginPath in tandem was the key.