Open SvenEwald opened 8 years ago
I just tried to reproduce this. But for me this works.
So I do need a bit more information. Or if possible a sample channel.
Do you have the P2 Metadata aspect active in this channel?
It works in a new created channel, so I removed aspects until it worked in my update site channel. Reason was the cleanup aspect. I use the core information aspect to exctract osgi:name and osgi:version The cleanup is aggregating over osgi:name and sorting by osgi:version, number of entries is one. This setup seems to delete the category.xml Can I use the cleanup, keeping only the last version of a bundle and use a category.xml ?
Actually the core information aspect should provide core:name
and the OSGi aspect will provide osgi:name
. Of course any artifact that is not an OSGi bundle will not have osgi:name
set. So these will get aggregated into a "empty string" group and only one of those "empty string" artifacts will survive.
Can you make a test of the cleanup with the "Test" button, this should give a pretty good overview of what will happen during the clean up.
I understand the reason for the effect. But this means we can have either a category in the update site, or having automatic cleanup. Right? I smell a missing feature ;-)
It always smells like missing features ... and I really hope they small like :hamburger:
So if your are bound to using osgi:name
I fear "yes". If you can use core:name
is should be possible, since they are different.
Without having tested it, there may be a way to use an additional property, assign it to the category and include this in the list of aggregating fields. Since this should collapse to an empty string for OSGi bundles and would not make a difference then.
For OSGI bundles, the core:name is the filename. So this can not be used for aggregation, because it contains the version. I'm not bound to the osgi:name, but the maven group id and artifact id don't work for osgi bundles.
So in the end, if the artifacts does not have the property osgi:name
you want to ignore it? Right?
So I could add a feature that an artifact is only considered for cleanup if "all aggregation properties are present".
Just as a side note ... I am currently working on a feature to actually trigger the clean up in different instances (per channel) at different times (timer, artifact upload, …) However, this will take a bit longer to implement and will not make it into 0.11.x and 0.12.x.
This could solve my requirement. In the mean time I will disable the cleanup and manually delete old snapshot bundles. (Every commit adds a new bundle with new qualifier) Alternative could be a whitelist of artifacts not to be cleaned. Whatever is easier.
Version 0.11.6 After generating a P2 feature or category or uploading a category.xml, there is no feature or category shown in channel content. Accessing the channel via eclipse does not show category or feature. No erro shown in log.