DEVCON 2026    |    2-5 November 2026 – QEII Centre – London, UK    |    Register now! 

Blogs

Include Versions or Not?

When using the Target Platform, sometimes you need the version, sometimes you don't.

David H Nebinger
David H Nebinger
読了時間: 1分未満

Just a quick post today...

So I've been using the Target Platform like all the time now. I don't want to have to worry about versions, especially those Liferay modules that change version numbers on every fix pack...

However, I've found that sometimes the version numbers just aren't there. But often I only find this out after I've stripped out the version and tried a build.

My friend Greg Amerson shared a trick with me today to help figure out if I can strip the versions or not, and I wanted to share it with you...

So, assuming you've enabled the target platform in your gradle.properties file in the root of your workspace, you can issue the following command:

$ gradlew dependencyManagement | grep osgi.service.component
<-------------> 0% EXECUTING [0s]
> :modules:headless-vitamins-test:dependencyManagement
    org.osgi:org.osgi.service.component.annotations 1.3.0
    org.osgi:org.osgi.service.component.annotations 1.3.0

If you get a match for what you're looking for, then you don't need to specify the version.

If you don't get a match, then the version is not available in the target platform BOMs and you will need to include the version in your dependency list.

Enjoy!

ページコメント

Great but it is possible in maven ? 

Yes, in your maven poms you can import the 3 Liferay BOMs located at this coordinates: com.liferay.portal:release.portal.bom:${liferayVersion} com.liferay.portal:release.portal.bom.compile.only:${liferayVersion} com.liferay.portal:release.portal.bom.third.party:${liferayVersion}

Related Assets...

結果が見つかりません。

More Blog Entries...

David H Nebinger
9月 28, 2026
David H Nebinger
9月 25, 2026
David H Nebinger
9月 23, 2026