Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[p2-dev] How to override Profile Properties ?

Hi All,

Can I please know whether it's possible to override Profile properties at runtime?
What I'm looking for is a way to override the bundle-pool location used by the Profile to extract features and plugins during feature installation.

In a previous thread, I learned that the bundle pool location (/features, /plugins directories) is located by the
org.eclipse.equinox.p2.cache property value.
I gave this as a profile property when invoking p2-director. I'm also using -roaming enabled for my application.

However during runtime, I see that the
org.eclipse.equinox.p2.cache property is initialized to /dileepa/kernel/trunk/distribution/kernel/target/wso2carbon-core-4.1.0-SNAPSHOT/repository/components/WSO2CarbonProfile
This is not the place I specified p2.cache to point to. I want it to be pointed to
/dileepa/kernel/trunk/distribution/kernel/target/wso2carbon-core-4.1.0-SNAPSHOT/repository/components (I suspect with -roaming enabled, the profile-property value I set for p2.cache has been modified internaly by P2)

As there is no direct method to override the p2.cache profile property, I tried ;
profileRegistry.setProfileStateProperty(IProfileRegistry.SELF, timeStamp, "org.eclipse.equinox.p2.cache", System.getProperty("carbon.home") + File.separator + "repository" + File.separator +"components");
But this was not successful and the features were still extracted at repository/components/WSO2CarbonProfile directory and the p2 instructions to copy certain files during feature installation fail, due to incorrect file-paths to source.
Then I learned that my change above using setProfileStateProperty() is not useful at all since in p2.touchpoint.eclipse.util [1] uses;

profile.getProperty(IProfile.); and not profile.getPropertyState()

Can I please know a way to override the p2.cache property for my running profile during runtime?

Thanks,
Dileepa



[1] http://grepcode.com/file/repository.grepcode.com/java/eclipse.org/3.6.1/org.eclipse.equinox.p2.touchpoint/eclipse/2.0.2/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java#Util.getConfigurationFolder%28org.eclipse.equinox.p2.engine.IProfile%29



Back to the top