Search code examples
eclipsep2pde

How to stop the p2 director from resolving optional dependencies for one of our plugins?


We have a PDE build creating a big p2 repository. We skip the p2 director during the PDE build to call the p2.director on a specific feature (a sub-feature of what has been built).

The problem is that one of our plugins is having an optional dependency that we do not want to be satisfied, whereas all other optional dependencies should be satisfied. Is this possible?


Solution

  • I have finally manage to tell p2 to avoid looking for optionnal dependencies only in this plugin by creating a p2.inf file in the META-INF/ folder of the plugin.

    the p2.inf is just telling that the optional imported package(s) is non greedy meaning it does not try to resolve this dependency.

    Here is an example :

    requires.0.namespace=java.package
    requires.0.name=com.lowagie.text
    requires.0.greedy=false
    requires.0.optional=true
    requires.1.namespace=java.package
    requires.1.name=com.lowagie.text.exceptions
    requires.1.greedy=false
    requires.1.optional=true