I have recently enabled baselining for a few of our projects. My expectation was that when nothing changed in the source of a certain project, baselining would not complain. However, even without any change (not in code, nor in any configuration file), I get an error in Eclipse saying all classes got added and removed. I checked the SHA’s of two versions of a class and they indeed are different, but that seems to be because Eclipse generates slightly different bytecode than the one in the bundle used to baseline against.
Baselining the generated jar against the bundle in the baseline repo does succeed. Indeed, the SHAs of the classes in the generated jar are equal to the SHAs of the classes in the baseline bundle.
How do I best approach this situation? Any suggestions? Thanks!
When a path of a class is present in the source directory (OSGI-OPT/src/) then no resource SHA is calculated. The assumption is that any differences will be reported on the source of the class, which is a lot more readable.
Does that mean that the only option to not have these errors is to include sources in the baseline bundles? Currently they indeed don’t include sources.
Does that mean that the only option to not have these errors is to include sources in the baseline bundles?
Yes.
There is very little difference between the information in your class file and the source files looking at today’s decompilers
If you really can’t have the sources in the repo you have a problem. Otherwise they’re easy to strip before deployment. All sources are in the OSGI-OPT/src directory.
Technically it would be possible to add the SHA’s of the sources in the manifest and use those but that would be work to implement …
If you really can’t have the sources in the repo you have a problem. Otherwise they’re easy to strip before deployment. All sources are in the OSGI-OPT/src directory.
Technically it would be possible to add the SHA’s of the sources in the manifest and use those but that would be work to implement …
Thanks for the information, it is possible to include sources, we just did not do that until now.