Package range version definition

thumbnail
Enrico Oliosi, modified 7 Years ago. Junior Member Posts: 73 Join Date: 7/6/10 Recent Posts

Hi all. I opened MANIFEST.MF file inside the portal-kernel.jar. I found this declaration:

[...]
Import-Package: com.liferay.announcements.kernel.exception;version="[1.0,2)",com.liferay.announcements.kernel.model;
version="[1.0,1.1)",com.liferay.asset.kernel;version="[1.1,2)"[...]

How is the range version created? Why is defined the range version for the package "com.liferay.announcements.kernel.model"? Why the upper limit is 1.1 and not 2?

 

Thanks in advance.

 

Enrico

thumbnail
Milen Dyankov, modified 7 Years ago. Expert Posts: 310 Join Date: 10/30/12 Recent Posts

Typically the range is created by Bnd. It inspects the code and figures out what packages give package uses. Then it finds the packages on the classpath and tries to determine what is the version in use. If the package is versioned the range is generated. Depending on whether the package contains only consumer types (default) or also provider types it will either create the upper limit to be next major or next minor version. The idea here is that providers may brake on minor changes while consumers should never do so.

thumbnail
Enrico Oliosi, modified 7 Years ago. Junior Member Posts: 73 Join Date: 7/6/10 Recent Posts

Thanks Milen, if I implement a module for 7.0.5-GA6 platform I hope that the same module will work on 7.0.6-GA7? or the minor version

of the provider type package could be change?

 

thumbnail
Milen Dyankov, modified 7 Years ago. Expert Posts: 310 Join Date: 10/30/12 Recent Posts

That is a good question. In theory it should not change between GA releases. But as those versions (7.0, 7.1, ...) are more of marketing versions than semantically versioned product releases, the reality is sometime bundles get updated in between GA releases.  So I'd say you should treat next GA release more or less as next minor version update which means assume bundles and packages will be updated.