Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Brett Lewinski
Portlet Version Information
December 4, 2012 11:06 AM
Answer

Brett Lewinski

Rank: Junior Member

Posts: 53

Join Date: May 3, 2011

Recent Posts

Hello -

Wondering if anyone has seen this before. We have developed a few custom hooks and portlets. In each of these we add a version and a build number to the Implementation-Version attribute in the MANIFEST.MF file for inclusion in the war. This information is showing up in the Control Panel -> Update Manager (under the Installed Version column) for some of the custom plugins, for others it either doesn't update or simple displays 6.0.12 and we want this to be displayed here. It appears as if this is not updated or not read or something, I can't put my finger on it. Has anyone out there seen this before? If so any info would be much appreciated.

Thanks in advance!
Brett
David H Nebinger
RE: Portlet Version Information
December 4, 2012 1:21 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11770

Join Date: September 1, 2006

Recent Posts

I thought the version was supposed to come from the liferay-plugin-package.properties file, not from some value in the manifest of a jar...
Brett Lewinski
RE: Portlet Version Information
December 4, 2012 1:37 PM
Answer

Brett Lewinski

Rank: Junior Member

Posts: 53

Join Date: May 3, 2011

Recent Posts

It is coming from the MANIFEST.MF in the war not a jar file. For some of our portlets (wars) we do not have a liferay-plugin-package.properties and the info in the MANIFEST.MF is displaying fine in the Update Manager.
Brett Lewinski
RE: Portlet Version Information
December 6, 2012 11:12 AM
Answer

Brett Lewinski

Rank: Junior Member

Posts: 53

Join Date: May 3, 2011

Recent Posts

Here is an update on our findings. Turns out if the portlet (war) has a liferay-plugin-package.properties file the version information will be read from there. If the liferay-plugin-package.properties file doesn't exist (in our case it didn't) it is read from the MANIFEST.MF file. For our particular issues it turns out that an administrator re-packaged the war before it was deployed thus creating a new MANIFEST.MF file without the version information. That issue is solved for us.

I do have a follow up question though. If we decide to go the liferay-plugin-package.properties route vs using the MANIFEST.MF file what attribute needs to get set so that our version info (1.0.1 Build 1234) is displayed on the Update Manager page under the Installed Version column?

Any info would be appreciated.

Thanks
Brett
David H Nebinger
RE: Portlet Version Information
December 6, 2012 12:53 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11770

Join Date: September 1, 2006

Recent Posts

It's the "module-incremental-version" key, and you can use any string you want there.

Note that the liferay-plugin-package.properties file can be used for a couple of better things than just versioning:

1. For required deployment contexts, the IDE will include the service jar from the given project. This is extremely useful for using services defined in another plugin. Liferay will also not load the plugin until the other ones (the required ones) have been successfully loaded, helping to ensure that you get some control over portlet startup order.

2. For the portal dependency jars, you can leave the jar out of your own WEB-INF/lib directory if it is available in the portal. This is great because it can really slim down your WAR deployment artifact. At deployment time, Liferay will pull the portal dependency jar and add it automagically to your exploded WAR's WEB-INF/lib directory. This can also be used to ensure that your plugins have the same version(s) of the jars as the portal and you don't have a mix of different versions used across different plugins.
Brett Lewinski
RE: Portlet Version Information
December 6, 2012 1:50 PM
Answer

Brett Lewinski

Rank: Junior Member

Posts: 53

Join Date: May 3, 2011

Recent Posts

David -

Thanks for the info, we will definitely investigate the advantages of doing things this way. From time to time we come across issues regarding shared jars and jars used across multiple portlets etc. This may have the potential to help us, I do need to look into it further though.

On another note I updated the module-incremental-version key with version 1.0 Build 1288 and on the Control Panel -> Update Manager it is still showing 6.0.12 not the 1.0 Build 1288 as we desire.

Any ideas of why it may not be picking it up, I uninstalled and reinstalled the hook with no difference.

thanks again, your help is very much appreciated.

Brett
Riccardo Rotondo
RE: Portlet Version Information
December 12, 2013 4:20 AM
Answer

Riccardo Rotondo

Rank: Junior Member

Posts: 29

Join Date: June 11, 2010

Recent Posts

Hi to all,

is there any way to show the portlet version in a jsp page?

Looking around I found this object:

 1
 2<%@page import="com.liferay.portal.model.Portlet"%>
 3<%@page import="com.liferay.portal.service.PortletLocalServiceUtil"%>
 4<%@include file="../init.jsp" %>
 5
 6<portlet:defineObjects />
 7
 8<%
 9Portlet dataPortlet =
10        PortletLocalServiceUtil.getPortletById("DataPortlet_WAR_einfrsrvportlet");
11%>

but then I don't find any method for Portlet object to the get the portlet version.

Any hint?

Cheers,
Riccardo
Brett Lewinski
RE: Portlet Version Information
December 12, 2013 6:35 AM
Answer

Brett Lewinski

Rank: Junior Member

Posts: 53

Join Date: May 3, 2011

Recent Posts

Riccardo -

Not sure about how to get it in a jsp page, that wasn't our requirement. All we needed to do was display it in the Control Panel on the Update Manager. We accomplished this by using the MANIFEST.MF for our custom portlets.

If you find the answer to your query I'd be interested in hearing what it is.

Brett