如果要在 RCP 应用程序开发中添加本地 p2 更新站点,如何使用 Tycho 在 pom.xml 的 <repository> 部分中指定 <id> 和 <url>?

How to specify <id> and <url> in <repository> section of pom.xml with Tycho if want to add a local p2 update site in RCP application development?

我是运行一个本地p2更新站点,关注this,接下来我想使用Maven和Tycho插件来构建我的插件项目。如何将本地 p2 更新站点添加到 pom.xml?特别是<id><url>不知道怎么填。目前。我的 <repository> 部分如下。

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

I'm running a local p2 update site by following this, next I want to use Maven and Tycho plugin to build my plug-in project. How can I add the local p2 update site into pom.xml? In particular, I don't know how to fill in and . For now. my section is as following.

  • <id> 可以是任意的,但在您的构建中应该是唯一的(即,没有两个 <url> 应该具有相同的 <id>)。
  • <url> 需要是指向本地 p2 更新站点内容的 http: URL(由 p2-maven-plugin. 引用 README of the p2-maven-plugin:

    Unfortunately, it's not the end of the story since tycho does not support local repositories (being more precise: repositories located in a local folder). The only way to work it around is to expose our newly created update site using an HTTP server. We're going to use the jetty-plugin - don't worry, the example above contains a sample jetty-plugin set-up. Just type 'mvn jetty:run' and open the following link http://localhost:8080/site. Your P2 update site will be there!

我希望这足以让您入门。