Search code examples
javamaveneclipse-rcpmaven-3tycho

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?


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 <id> and <url>. For now. my <repository> section is as following.

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

Solution

  • 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> can be arbitrary, but should be unique in your build (i.e., no two <url>s should have the same <id>).
    • <url> needs to be an http: URL pointing to the contents of your local p2 update site (what gets put into the target/repository directory by the p2-maven-plugin. Quoting the 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!

    I hope that is enough to get you started.