3

All I have is a Gogo Shell connection to a Liferay server.

From that shell, is there any way to know the version of the com.liferay.portal.kernel package used by that server?

For instance, if I want to know the version of the com.liferay.util.taglib package I would type lb | grep Taglib | grep Util and see that the version is 2.9.0, but the same method does not seem to work for the kernel package.

Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373

3 Answers3

4

portal-kernel.jar is still in the global classpath (lib/ext folder). Not sure you can handle it through the OSGi container.

You can check the installed version in its manifest file inside that jar.

Anyways, I guess you're asking in order to set the dependency in your developments. If that's the case, I would recomend to set the older version you can use in terms of compatibility (see a post by Nebinger talking about that: https://community.liferay.com/es/blogs/-/blogs/choosing-osgi-versions-during-development)

Your best bet is not always using the latest version for a dependency.

  • So this command gives the version I guess? `unzip -j $LIFERAY_HOME/tomcat/lib/ext/portal-kernel.jar META-INF/MANIFEST.MF -d /tmp/; grep "^Bundle-Version" /tmp/MANIFEST.MF` – Nicolas Raoul Apr 17 '19 at 09:50
  • 1
    If you are at the server, why not? Even better using zgrep or similar tools, so you dont have to unzip the jar first, leaving it there. `zgrep "^Bundle-Version" $LIFERAY_HOME/tomcat/lib/ext/portal-kernel.jar` – Juan Manuel Rogado Apr 17 '19 at 10:06
0

Maybe using gogo shell is not possible.

You can reach the version number calling json web service:

λ curl http://localhost:8080/api/jsonws/portal/get-build-number -u user:pwd

Daniele Baggio
  • 2,157
  • 1
  • 14
  • 21
0

You could also use:

lb | grep Foundation

To fetch the "Liferay Foundation" Version which correspond to something like 7.0.72 for a DXP7.0 environment. I am not sure if this applies to DXP7.1 as well.

Andre Albert
  • 1,386
  • 8
  • 17
  • The highest ever version of com.liferay.portal.kernel is `3.61.0`, see https://mvnrepository.com/artifact/com.liferay.portal/com.liferay.portal.kernel – Nicolas Raoul Apr 16 '19 at 09:21
  • 1
    OK, sorry. The snippet will return the DXP version which is not the same as the kernel version. – Andre Albert Apr 16 '19 at 09:23