[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] I surrender


p2 expects the application you are installing into to have been p2-enabled. This means that the basic Eclipse install you have and in which you are installing should have a p2 folder in its root. You get to that state by installing this base with p2 itself.
To be able to install something with p2 you need to have p2 metadata for it. So the first problem is to generate p2 metadata for the complete installation.
There are two ways to get to that:
- Use PDE Build or Tycho to build the product and get them to generate complete metadata for the product and produce the p2 enabled product. This is the recommended way (this is for ppl running into this post without the complete background).
- Generate metadata on the result of your own build using the org.eclipse.equinox.p2.publisher.InstallPublisher. This application takes as input an eclipse install and generate p2 metadata and artifact from it. With the repositories produced by this application you can then use the p2 director to get the p2 enabled application.

Should you care about the p2 folder?
No. The p2 folder is not something that you have to edit. It is p2 internal representation of what it knows about the system being managed.

Are you trying to figure this out from a selfhosted environment? The support for running p2 in a selfhosted environment is not ideal and this may be one of the reason. 


Training, consulting, bug fixing - pascal at rapicault dot net

On 2012-04-25, at 10:17 PM, Chip Downs wrote:

> This is really frustrating. I can't get my extremely simple plugin to install from a local update site. It's probably because my product isn't properly p2-enabled, but I'm not entirely sure.
> Here's my situation...
> I've got a 3.5 RCP app. It's big. Hundreds of plugins. For various reasons--particularly because I'm inside a firewall in a closed network--I can't upgrade to 3.7 for a while, so I need to make it work in 3.5. We're using an older version of Tycho, so p2-enabling through the PDE API isn't available to me either. Basically, I have to enable my product for p2 after it's already built.
> I used the FeaturesAndBundledPublisher to create my repository, even though I had to comment out in the feature.xml files some plugins with non-compliant version numbers. Then I used eclipsesec.exe and the director app to install one of the features into my product, hoping that it would create the proper p2 directories and whatnot. 
> I seem to get org.eclipse.equinox.p2.core and org.eclipse.equinox.p2.engine directories well enough (including my profile), but no org.eclipse.equinox.p2.repository directory. I'm not even sure that's required, but there's one under the normal eclipse install, so it looked suspiciously absent. I'm also missing an org.eclipse.equinox.simpleconfigurator directory under configuration, not to mention two other org.eclipse.equinox.* directories that I see in the regular Eclipse install. Frankly, I don't see anywhere in your documentation how those directories even get created from the p2 APIs. Am I supposed to manually put them in? All I've got is my config.ini file, which has suited our uses for 4 years.
> When I try to install my plugin via my update site, everything looks just fine. It says that it's installed and I can uninstall it too. However, my sample view doesn't show up, even after restarting. I can see it if I start up the plugin with the product through the IDE debug config, but not after installing through the p2 UI.
> I'm lost even looking for the installed jar(s). There must be some serious magic going on (magic is bad!). I can delete my runtime workspace and completely rebuild my p2 directory, yet my product still remembers my installed plugin and its history. Where does that info even get stored?
> Anyway, if I don't get this figured out, my project is in serious jeopardy. We need to get a handle on p2 to make our product my flexible and deployable. It's just too big to be deploying a 1/2 GB zip anymore.
> Please help me understand:
>  1) What I'm probably missing (directories, configuration, etc.)
>  2) Some insider advice on how to troubleshoot it better
>  3) Where the heck installed features/plug-ins' jars are stored and how to configure it to go elsewhere (particularly a networked drive)
>  4) How to p2-enable an existing product via the APIs (by the way, how come the Wiki mentions an InstallPublisher but doesn't provide any details?)
> Thanks,
> Chip Downs
> _______________________________________________
> p2-dev mailing list
> p2-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/p2-dev