[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[p2-dev] How to override Profile Properties ?
- From: Dileepa Jayakody <dileepa@xxxxxxxx>
- Date: Thu, 28 Feb 2013 03:04:42 +0530
- Delivered-to: firstname.lastname@example.org
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  uses;
profile.getProperty(IProfile.PROP_CACHE); and not profile.getPropertyState()
Can I please know a way to override the p2.cache property for my running profile during runtime?