如何使用 maven 构建 Eclipse 插件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6830399/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:42:16  来源:igfitidea点击:

How to build an Eclipse plugin with maven?

eclipsemaveneclipse-plugin

提问by Walter

How do you build an Eclipse plugin with Maven? What dependencies or plugins do I need? I am looking to develop for Eclipse 3.7.

如何使用 Maven 构建 Eclipse 插件?我需要什么依赖项或插件?我希望为 Eclipse 3.7 进行开发。

回答by shen ke

You can use Maven 3.3 (at least) and Maven Tycho 0.24.0. Add this to your project's .mvn/extensions.xml:

您可以使用 Maven 3.3(至少)和 Maven Tycho 0.24.0。将此添加到您项目的.mvn/extensions.xml

<extensions>
  <extension>
    <groupId>org.eclipse.tycho.extras</groupId>
    <artifactId>tycho-pomless</artifactId>
    <version>0.26.0</version>
  </extension>
</extensions>

Then you must define your pom.xml according to the structure of your project. I recommend this article: Eclipse Tycho for building Eclipse Plug-ins, OSGi bundles and RCP applications - Tutorial

然后你必须根据你的项目结构定义你的 pom.xml。我推荐这篇文章:Eclipse Tycho 用于构建 Eclipse 插件、OSGi 包和 RCP 应用程序 - 教程

You can follow the example on this page to have a general idea of using maven plugin Tycho.

您可以按照此页面上的示例对使用 Maven 插件 Tycho 有一个大致的了解。