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
RE: Unresolved requirement for non-existing version
Hi,
I'm trying to work with the journalArticleLocalService in a custom module. For this I added a dependency to my build.gradle file:
compile group: 'com.liferay', name: 'com.liferay.journal.api', version: '4.4.0'
When I try to deploy this module, I'm getting an error:
org.osgi.framework.BundleException: Could not resolve module: content.manager [1098]_ Unresolved requirement: Import-Package: com.liferay.journal.service; version="[2.7.0,3.0.0)"_ [Sanitized]
So I go to mvnrepository and look for the correct dependency for com.liferay.journal.service: https://mvnrepository.com/artifact/com.liferay/com.liferay.journal.service
But there is no version between 2.7.0 and 3.0.0
What do I do now?
I'm trying to work with the journalArticleLocalService in a custom module. For this I added a dependency to my build.gradle file:
compile group: 'com.liferay', name: 'com.liferay.journal.api', version: '4.4.0'
When I try to deploy this module, I'm getting an error:
org.osgi.framework.BundleException: Could not resolve module: content.manager [1098]_ Unresolved requirement: Import-Package: com.liferay.journal.service; version="[2.7.0,3.0.0)"_ [Sanitized]
So I go to mvnrepository and look for the correct dependency for com.liferay.journal.service: https://mvnrepository.com/artifact/com.liferay/com.liferay.journal.service
But there is no version between 2.7.0 and 3.0.0
What do I do now?
It's a bit misleading.
Each jar file has a bundle version. That version is what you request using gradle/maven. But each package inside also has a version. And with Liferay, this version usually is different from the bundle version.
You probably need
compile group: 'com.liferay', name: 'com.liferay.journal.api', version: '3.0.0'
As a rule of thumb:
Look at the release time of your Liferay version. e.g. for 7.1 that was early July 2018. When a new version is released, Liferay bumps the bundle version. In maven repository you see that com.liferay.journal.api 3.0.0 was released in June 2018. That's probably the version you need. Using the lowest major version is usually fine in OSGI since it allows you to support the most installations.
Each jar file has a bundle version. That version is what you request using gradle/maven. But each package inside also has a version. And with Liferay, this version usually is different from the bundle version.
You probably need
compile group: 'com.liferay', name: 'com.liferay.journal.api', version: '3.0.0'
As a rule of thumb:
Look at the release time of your Liferay version. e.g. for 7.1 that was early July 2018. When a new version is released, Liferay bumps the bundle version. In maven repository you see that com.liferay.journal.api 3.0.0 was released in June 2018. That's probably the version you need. Using the lowest major version is usually fine in OSGI since it allows you to support the most installations.
Ok good to know! I'm working with Liferay 7.2, changed the com.liferay.journal.api version to 4.3.0 (for June 2019) and it works!Thank you!
Hey Tom,Just to give you another reference (sometimes we don't have internet connections!) .. you can look it up in the bnd file with the module in the portal source of course, but there is also a file in the portal source called module.properties which contains a list that easy peasy to look up. The only thing you have to remember to do is subtract 1 point version off the value listed. So for example, I am looking at the file for 7.1 GA4 source and it has com.liferay.journal.api=3.5.8 .. so in my dependencies I would specify com.liferay.journal.api=3.5.7
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™