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.
com.packtpub.e4.update
project underneath the com.packtpub.e4.parent
project.<module>com.packtpub.e4.update</module>
to the parent pom.xml
file.pom.xml
file from the clock
plugin to the update
project.<packaging>eclipse-repository</packaging>
.artifactId
to com.packtpub.e4.update
.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>
site.xml
file to category.xml
. (This is an entirely pointless change required by p2
since the files are identical in format.)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">
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
file:///path/to/com.packtpub.e4.parent/com.packtpub.e4.update/target/repository
into the work with field, and installing the feature shown there.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.