Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Problems with com.liferay.portal.kernel.util dependency for 7.1
Hi everyone. I am in the middle of migrating some stuff into 7.1 and just ran into a problem. In one of my projects I have such dependency:
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>com.liferay.portal.kernel</artifactId>
<version>3.26.0</version>
<scope>provided</scope>
</dependency>
I changed version to the latest - 3.26.0 but when I deploy my bundle I am getting:
Unresolved requirement: Import-Package: com.liferay.portal.kernel.util; version="[7.3.0,8.0.0)"
So in the most recent available version (according to https://repository.liferay.com/nexus/service/local/repositories/liferay-public-releases/content/com/liferay/portal/com.liferay.portal.kernel/3.26.0/ it was published a couple of days ago) we have old version of packages that does not work with Liferay 7.1 (it has com.liferay.portal.kernel.util; version="8.0.0").
If I have not missed something in my logic please could you let me know when we could expect dependencies for Liferay 7.1?
Thanks a lot.
Andrey Filippov:I changed version to the latest - 3.26.0 but when I deploy my bundle I am getting:
Unresolved requirement: Import-Package: com.liferay.portal.kernel.util; version="[7.3.0,8.0.0)"
You should use the API version that shipped with 7.1
(com.liferay:com.liferay.portal.kernel:3.6.0), and not
the latest version. In general, especially with OSGi in play, there's
no guarantee that the latest version available through Maven is
backwards-compatible with the release of Liferay that you're using.
Thanks for the reply - changed to 3.6.0 but the problem still exists..
Andrey Filippov:Thanks for the reply - changed to 3.6.0 but the problem still exists..
I'm assuming that you checked the the output of mvn
dependency:tree, and so you've confirmed that Maven really is
using 3.6.0 at compile time, and it isn't getting overridden.
Assuming that's the case, there's something wrong with your Maven
configuration that's causing the Bnd tooling to use the wrong version
of com.liferay.portal.kernel when building out the OSGi
bundle manifest. If you have no idea what that is, you'll need to
share a lot more of the project than a snippet of a
pom.xml for anyone else to have a chance at guessing.
If sharing your entire project isn't an option, you can either start
from a vanilla workspace and slowly add projects to it, or you'll need
to craft the manifest by hand. For the latter, you can use the
existing MANIFEST.MF as a starting point and just modify the version
range for com.liferay.portal.kernel.util.
Sorry - that is my fault. I did not notice that bnd.bnd rewrites some packages..