如何在Tycho构建中添加依赖关系到Eclipse包 [英] How to add a dependency to an Eclipse bundle in a Tycho build

查看:339
本文介绍了如何在Tycho构建中添加依赖关系到Eclipse包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Maven模块中包含 org.eclipse.uml2.uml_4.0.0.v20120604-0919.jar 。我设置了p2存储库

I want to include org.eclipse.uml2.uml_4.0.0.v20120604-0919.jar in a Maven module. I've set up the p2 repository

<repository>
    <id>juno</id>
    <layout>p2</layout>
    <url>http://download.eclipse.org/releases/juno</url>
</repository>

并配置了Tycho构建扩展名。哪个 groupdId artifactId 我必须使用,以便Tycho将包括 org.eclipse。 uml2.uml_4.0.0.v20120604-0919.jar 作为依赖关系?

and configured the Tycho build extension. Which groupdId and artifactId do I have to use so that Tycho will include org.eclipse.uml2.uml_4.0.0.v20120604-0919.jar as a dependency?

推荐答案

在Tycho,您需要在OSGi清单文件( META-INF / MANIFEST.MF )中指定插件的依赖关系。所以对于给定的Eclipse插件,你可以写一些类似

In Tycho, you need to specify the dependencies of your plug-in in the OSGi manifest file (META-INF/MANIFEST.MF). So for the given Eclipse plugin, you would write something like

Require-Bundle: org.eclipse.uml2.uml

您不能通过POM配置执行相同操作。

You cannot do the same through POM configuration.

这样的想法是,Tycho遵循所谓的清单第一的方式。 Tycho的主要配置文件是OSGi清单和其他Eclipse PDE文件格式(如feature.xml,* .product文件等)。

The idea behind this is that Tycho follows the so-called Manifest-first approach. The primary configuration files for Tycho are the OSGi manifest and the other Eclipse PDE file formats (like feature.xml, *.product files, etc.).

其他工具,像maven-bundle-plugin一样,遵循构建OSGi软件包的

POM-first 方法。对于maven-bundle-plugin,您需要在POM中指定依赖关系,并相应地生成清单。

Other tools, like the maven-bundle-plugin follow the POM-first approach of building OSGi bundles. For the maven-bundle-plugin, you'd need to specify the dependencies in the POM, and the manifest is generated accordingly.

这篇关于如何在Tycho构建中添加依赖关系到Eclipse包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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