Skip to content

Updated osgi imports to not import the exports #513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 29, 2017
Merged

Updated osgi imports to not import the exports #513

merged 2 commits into from
Sep 29, 2017

Conversation

garethahealy
Copy link
Collaborator

Updated hibernate and javassist to allow for wider osgi versions - i.e.: don't be opinionated
Copy link
Contributor

@orange-buffalo orange-buffalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit concerned about manual handling of optional dependencies versions. Having different version numbers in project dependencies in POMs and in OSGi bundle descriptor seems to be dangerous to me. If we do not need new features/bug fixes/improvements of Hibernate or Javaassist, then we do not need to upgrade the dependencies and should keep them at the minimum required version.

@garethahealy
Copy link
Collaborator Author

@orange-buffalo ; for javassist, that would be OK, but for hibernate it would generate a version range of: 4.2,5, which would exclude latest.

@orange-buffalo
Copy link
Contributor

Indeed, default BND versioning scheme works this way. There is a configuration to override this (http://bnd.bndtools.org/chapters/170-versioning.html, section 10.8), but it will have effect for all imports, not sure if it can be specified for a single package.

But I believe we still can make changes in a way that avoids double-maintenance of version numbers if instead of

org.hibernate.proxy;version="[4.2,6)";resolution:=optional,

we have

org.hibernate.proxy;version="[${hibernate-core.version})";resolution:=optional,

Of course, to apply this we should specify the minimum version of Hibernate dependency we need.

PS. This is just a suggestion, I do not insist on making changes here.

@garethahealy
Copy link
Collaborator Author

Did you mean, i.e.: we provide minimum and current version:
org.hibernate.proxy;version="[4.2,${hibernate-core.version})";resolution:=optional,

As if we just did:
org.hibernate.proxy;version="[${hibernate-core.version})";resolution:=optional,

Isnt that the same as now?

@orange-buffalo
Copy link
Contributor

I see two aspects here.

First is that we have Hibernate dependency version defined in the project as 5.2.10.Final, although we need only one interface which is available since much earlier version (4.2?). In my view, we should keep project dependency at the minimum required version and then it can be used as a left inclusive range end (either by bundle plugin or via manual configuration using maven property).

Second thing is that for OSGi we basically need "unbound" version range, i.e. starting from the minimum required and with no right end. I found that this is supported by some providers (like here). Not sure what spec says about unbound range and if this semantic is supported by other vendors.
If it is commonly supported, we could use (assuming our project dependency version is downgraded):

org.hibernate.proxy;version="${hibernate-core.version}";resolution:=optional,

If not, than we should set the left end to our minimum required version, and the right end to some future major version (it is quite hard to say what will come with Hibernate 6 and 7, but for the time being we could assume they will not break proxy interface):

org.hibernate.proxy;version="[${hibernate-core.version},8)";resolution:=optional,

@garethahealy
Copy link
Collaborator Author

For time being, have commented out versions to be non-opinionated as theres no clean way to support this currently. will revisit.

@garethahealy garethahealy merged commit 5dc2730 into DozerMapper:master Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants