Skip to main content
Jump to: navigation, search

Using Policy Files

Revision as of 12:23, 24 December 2007 by (Talk | contribs) (Using the Policy File)

Policy files allow a user to configure where to search for updates to a feature when checking for updates.

Why would you want this?

  • For mirror control. With a policy file you can force your users to update from a mirror within your organization's firewall, instead of letting them choose a public mirror. This might give better performance or at least let you monitor the bits being transferred. Of course you'd have to be an Eclipse mirror first.
  • For patching. With a policy file you can update a publicly available EPL'd feature with your own custom version. Bear in mind doing so still must be done in adherence to EPL rules. See

Creating the Policy File

A sample policy file is shown below:

<?xml version="1.0" encoding="UTF-8"?>
  <url-map pattern="" url="http://hostname/update/nightly/policy.xml"/>

In this example, we save this to an XML file named "policy.xml". This is then placed next to the corresponding update site.xml. This effectively says "when I see feature with id x, instead go to update site y rather than the default". You can also use wildcards, such as* if you have multiple features with the same prefix.

If you wanted to update from a non-standard update site, you could use a policy file to redirect from the default Update site to a secondary one. For example:

<?xml version="1.0" encoding="UTF-8"?>
  <url-map pattern="*" url=""/>

Using the Policy File

In Eclipse, navigate to Window > Preferences > Install/Update, and paste in the URL to the policy file and hit OK, eg:
or, for a local file:

The next time you search for updates, Eclipse will use the URL specified in the policy file, instead of what's in the feature.xml files.

An additional thought is to provide a preference page to allow the end user to choose which "release stream" they wish to subscribe to. In this case, there is a radio button that might specify "stable", "rc" and "nightly". Selecting one of these radio buttons would automatically set the policy file behind the scenes.

Back to the top