I am currently working on liferay upgradation from 6.0
to 6.2.2 GA3
. I tried upgrading the services portlet. The services portlet of 6.0 version is built using mvn services-portlet-archetype whereas for 6.2 version the archetype is liferay-servicebuilder-archetype
. The difference is that in 6.2 liferay-servicebuilder-archetype there are two modules:
Module 1:
is a portlet which has our code logic
Module 2:
is the services-portlet which has the class files generated during liferay:build-service
. These files are archived into jar file which is later used inside the portlet(Module 1) module for the creation of the WAR file.
Whereas in 6.0, there is no concept of modules. The services class files generated during liferay:build-service
are generated inside services folder under src/
.
This liferay-servicebuilder-archetype
is available only from Liferay 6.1
+ versions as seen in mvnrepository. My guesses for the need of this new archetype from 6.1 version are:
1. To avoid committing the auto generated services files by mistake to our version control repo.
2. To be more modular.
But with this new archetype I found out that the build process consumes lot of permgen space and heap space(I have to double the heap and permgen space everytime I run the mvn clean package liferay:build-service
as observed through jvisualvm). I was able to create the same portlet with services-portlet-archetype
successfully deployed and working in 6.2 GA3 server(without extra permgen space and heapspace). But did not find any memory issues during its build.
My questions are:
1. Which of these two archetypes(liferay-servicebuilder-archetype
or services-portlet-archetype
) is a good practice for liferay 6.2 GA3.
2. Going forward if I need to upgrade all the 20+ portlets which I am using in my project should I need to create from archetype? (Takes lot of time and effort).
3. How to fix this issue of extra memory consumption if using liferay-servicebuilder-archetype
is the best practice. The target folder seems to produce more class files than in services-portlet-archetype
target folder.
4. The need for this new archetype is for the two benefits mentioned above(which I guessed) or is there anything else?
After waiting for 2+ weeks for an answer to this question, I am assuming that my following guesses are the correct answer to this question.
The need for this new archetype from 6.1 version is:
1. To avoid committing the auto generated services files by mistake to our version control repo.
2. To be more modular.
If there is a more convincing answer, I will choose that to be the best answer.
EDIT:::: Found this link useful https://www.liferay.com/community/forums/-/message_boards/message/51303796