如何使用本地目录作为 Tycho 构建的目标平台?
我想构建一个带有目标平台的 RCP 应用程序,该目标平台是 Maven/Tycho 的目录。
现在我遇到了一些依赖无法解决的麻烦。
Internal error: java.lang.RuntimeException: "No solution found because the
problem is unsatisfiable.": ["Unable to satisfy dependency from
de.test.prototype.main 1.0.0.qualifier to bundle org.eclipse.ui 0.0.0.",
"Unable to satisfy dependency from de.test.prototype.main 1.0.0.qualifier
to bundle org.eclipse.core.runtime 0.0.0.", ...
总而言之,存在几个依赖关系解析问题,因此我认为第谷无法使用我的目标平台。
我阅读了 http://wiki.eclipse.org/Tycho/Target_Platform 并有以下注释:
不支持位置类型“目录”、“安装”和“功能”。
所以我的问题是:如何让第谷使用我的目标平台,尽管它是一个目录?
I want to build an RCP-Application with a target platform which is a directory with Maven/Tycho.
Now I have some troubles that the dependencies could not be resolved.
Internal error: java.lang.RuntimeException: "No solution found because the
problem is unsatisfiable.": ["Unable to satisfy dependency from
de.test.prototype.main 1.0.0.qualifier to bundle org.eclipse.ui 0.0.0.",
"Unable to satisfy dependency from de.test.prototype.main 1.0.0.qualifier
to bundle org.eclipse.core.runtime 0.0.0.", ...
All in all there are several dependency resolution problems, so I think Tycho can't use my target platform.
I read http://wiki.eclipse.org/Tycho/Target_Platform and there is the following note:
The location types "Directory", "Installation", and "Features" are not supported."
So my question is: How do I get Tycho to use my target platform, although it is a directory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Tycho 需要 p2 元数据才能解决构建中的依赖关系。这就是为什么不能使用仅包含捆绑包和功能的文件夹的原因。
不过,您可以使用功能和捆绑包发布程序应用程序。完成此操作后,您可以通过目标定义文件中的
file:
URL 将该文件夹引用为“软件站点”位置。那么第谷也将能够使用它。但请注意,您应该首先问自己是否真的需要这样做:您的文件夹中的功能和捆绑包真的在任何 p2 存储库中都不可用吗?如果是,强烈建议不要在其上运行 Features and Bundles Publisher(否则您可能会违反 p2 的基本假设,从而导致通常仅对您的用户可见的问题)。相反,您应该直接从 p2 存储库引用这些功能和捆绑包,例如通过目标文件中的“软件站点”位置。
Tycho requires p2 metadata in order to resolve dependencies in your build. This is why a folder with just bundles and features can't be used.
However you can convert your folder into a p2 repository by using the Features and Bundles Publisher Application. After you have done this, you can to reference the folder as "Software Site" location through a
file:
URL in your target definition file. Then Tycho will also be able to use it.Note however that you should first be asking yourself if you really need to do this: Are the features and bundles in your folder really not available in any p2 repository? If they are, it is strongly recommended to not run the Features and Bundles Publisher on them (or you may be causing violations of basic assumptions of p2 which may lead to problems that are typically only visible to your users). Instead, you should reference these features and bundles directly from the p2 repository, e.g. via "Software Site" location in your target file.
从您的插件创建一个存储库,并将其上传到 http 服务器(如 apache),并将您的 tycho pom 指向该存储库。
此示例适用于 mac 和 eclipse 4,但通过一些调整,您可以使其在其他平台上工作。
首先在桌面上创建一个src文件夹。在此文件夹中创建 2 个文件夹:
特征
插件
现在将插件复制到插件文件夹中,将功能复制到功能文件夹中。
然后在某处创建一个空的目标文件夹(将此文件夹上传到您的服务器),
对于本例,我在桌面上创建了两个文件夹以保持简单
然后我这样做:
repo 文件夹现在包含目标平台的 repo。上传它,调整 pom 并构建。
Create a repo from your plug-ins and upload it to a http server ( like apache ) and point your tycho pom to the repo
This example is for the mac and eclipse 4 but with some tweaking you can make it work on other platforms.
first create a src folder on the desktop. In this folder create 2 folders :
features
plugins
Now copy your plugins in the plugins folder and features in the features folder.
Then create an empty destination folder somewhere ( upload this folder to your server)
for this example I created both my folders on the desktop to keep it simple
Then I do this :
The repo folder now contains a repo of your target platform. Upload it, adjust the pom and build.