Time for action – building an update site

The update site created in Chapter 8, Creating Features, Update Sites, Applications, and Products, is used to provide a standard hosting mechanism for Eclipse plug-ins and features. This can be built automatically with Tycho as well.

  1. Move the com.packtpub.e4.update project underneath the com.packtpub.e4.parent project.
  2. Add the line <module>com.packtpub.e4.update</module> to the parent pom.xml file.
  3. Copy the pom.xml file from the clock plugin to the update project.
  4. Modify the packaging to <packaging>eclipse-repository</packaging>.
  5. Change the artifactId to com.packtpub.e4.update.
  6. The resulting pom.xml file will look like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <project xsi:schemaLocation="http://maven.apache.org/
      POM/4.0.0 http://maven.apache.org/xsd/maven-
      4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <modelVersion>4.0.0</modelVersion>
      <parent>
        <groupId>com.packtpub.e4</groupId>
        <artifactId>com.packtpub.e4.parent</artifactId>
        <version>1.0.0-SNAPSHOT</version>
      </parent>
      <groupId>com.packtpub.e4</groupId>
      <artifactId>com.packtpub.e4.update</artifactId>
      <!-- version>1.0.0-SNAPSHOT</version -->
      <packaging>eclipse-repository</packaging>
    </project>
  7. Rename the site.xml file to category.xml. (This is an entirely pointless change required by p2 since the files are identical in format.)
  8. Verify that the category.xml file does not contain a url attribute and that the version attribute is 0.0.0, otherwise the message Unable to satisfy dependencies may be seen.
    <feature id="com.packtpub.e4.feature" version="0.0.0">
  9. Run mvn package from the parent project and it should now build the update site as well:
    [INFO] Reactor Summary:
    [INFO] 
    [INFO] com.packtpub.e4.parent .................. SUCCESS [0.048s]
    [INFO] com.packtpub.e4.clock.ui ................ SUCCESS [1.416s]
    [INFO] com.packtpub.e4.feature ................. SUCCESS [0.074s]
    [INFO] com.packtpub.e4.update .................. SUCCESS [2.727s]
    [INFO] BUILD SUCCESS
  10. In Eclipse, install the update site by going to Help | Install New Software and typing file:///path/to/com.packtpub.e4.parent/com.packtpub.e4.update/target/repository into the work with field, and installing the feature shown there.

What just happened?

Creating an update site is no different from creating a plug-in or feature project. There is a pom.xml file that defines the name of the update site itself, and it uses or detects the file called category.xml to generate the update site.

The category.xml file is functionally equivalent to the site.xml file created previously, and is a name change introduced by p2 some four or five releases ago. However, the update site project still generates it using the old name, so it may be necessary to rename it from site.xml to category.xml in order to be built with Tycho. (There is an eclipse-update-site packaging type that uses the site.xml file as-is, but this is deprecated and may be removed in future versions.)

As with the Eclipse update project, when the update site is built, the versions of the features and plug-ins in the category.xml file are replaced with the versions of the features and plug-ins just built.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset