Foros de discusión

Liferay 6.1.x Maven Support

thumbnail
Carlos Adolfo Ortiz Quirós, modificado hace 10 años.

Liferay 6.1.x Maven Support

Junior Member Mensajes: 40 Fecha de incorporación: 22/05/10 Mensajes recientes
Hi everyone

Today I am writing this thread to you in order for a help.
Question is:
I am trying to getting started using Maven support in Liferay V6.1.x which is officially supported. I want to know if you do know of any tutorials, step by step documents, anything that happens to help in this task.

Besides I would like to ask about the version supported and considerations to have at it.

Is this maven support provided for all the Liferay development cycles, I now think of plugin(porlet), and themes, which is notably what I need it most?
thumbnail
Jeffrey Handa, modificado hace 10 años.

RE: Liferay 6.1.x Maven Support

Liferay Master Mensajes: 541 Fecha de incorporación: 1/12/08 Mensajes recientes
Hi Carlos,

Have you reviewed the Developing plugins using Maven chapter of the Liferay Developer Guide?

I know Jim and his team worked hard on the documentation so if there's any info that's lacking, please let us know so we can improve it.
thumbnail
Carlos Adolfo Ortiz Quirós, modificado hace 10 años.

RE: Liferay 6.1.x Maven Support

Junior Member Mensajes: 40 Fecha de incorporación: 22/05/10 Mensajes recientes
That is one of my source for documentation.
But I would like to see a step by step tutorial, a true getting started.
thumbnail
Jim Hinkey, modificado hace 10 años.

RE: Liferay 6.1.x Maven Support

Junior Member Mensajes: 62 Fecha de incorporación: 15/02/11 Mensajes recientes
Hi Carlos,

Is there a step in using Maven for plugin development where you are stuck? We tried to write the Developing Plugins using Maven chapter in such a way that it takes you step by step through the following, as is listed in links at the bottom of the chapter introduction:

Installing Maven
Using Maven repositories
Installing required Liferay artifacts
Using a parent plugin project
Creating Liferay plugins with Maven
Deploying Liferay plugins with Maven
Liferay plugin types to develop with Maven

Each of these sections has numbered step-by-step instructions for you to achieve these goals. With regards to developing portlets and themes, we give you the steps for generating the appropriate project, describe the anatomy of each plugin type in Maven, and explain how to deploy to Liferay. As far as portlet development and theme development, we reference previous Dev Guide chapters on those topics, as they apply to portlet and theme development regardless of whether you are using Maven.

If there is a step(s) that you find is missing, please let us know.

Thanks
thumbnail
Carlos Adolfo Ortiz Quirós, modificado hace 10 años.

RE: Liferay 6.1.x Maven Support

Junior Member Mensajes: 40 Fecha de incorporación: 22/05/10 Mensajes recientes
Hi Jim Hinkey

Thank you very much for your explanation. I will have a seat and a cup of coffee to digest your information in the developer guide.

One last thing, then, what is the difference between portlet development and plugin development?
Besides, I wonder if the maven support includes development of plugin, porlet, hooks, themes, etc., other such artifacts for the CMS?

Regards
thumbnail
Jim Hinkey, modificado hace 10 años.

RE: Liferay 6.1.x Maven Support

Junior Member Mensajes: 62 Fecha de incorporación: 15/02/11 Mensajes recientes
Hi Carlos,

You are certainly welcome. I appreciate your questions.

Portlets, themes, hooks, layout templates, webs, and Ext are different types of Liferay plugins (see http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/liferay-plugin-types-to-develop-with-maven). There are several types of portlets for which we provide Maven archetypes, too.

Enjoy your cup of coffee ... or two. I'm excited to learn your progress. ;-)
thumbnail
Carlos Adolfo Ortiz Quirós, modificado hace 10 años.

RE: Liferay 6.1.x Maven Support

Junior Member Mensajes: 40 Fecha de incorporación: 22/05/10 Mensajes recientes
Well. I have read the guide.
Cool. It worked and I now know how to use Maven Support.

But, The chapter is mingled with instructions for both remote or local, and also with the choice to compile from source or download.
It would be clearer if sections are separated in different isolated paths. I mean, if I want do download the maven support and use local then there should be two different numerals for the matter, and like so!
thumbnail
Jim Hinkey, modificado hace 10 años.

RE: Liferay 6.1.x Maven Support

Junior Member Mensajes: 62 Fecha de incorporación: 15/02/11 Mensajes recientes
Carlos,

You bring up a good point. I see how explaining different tracks, would be helpful. We'll consider that when we update that chapter.

Thanks for your input. And glad you are developing Liferay plugins with our artifacts!

Jim
thumbnail
Carlos Adolfo Ortiz Quirós, modificado hace 10 años.

RE: Liferay 6.1.x Maven Support

Junior Member Mensajes: 40 Fecha de incorporación: 22/05/10 Mensajes recientes
Hey. Thank you. I am glad I can be of any help.

Now I wonder if it is possible to use 'mvn liferay:deploy' in the parent directory in order to deploy all of the artifacts it contains all at once.
I wonder when Liferay IDE 2.0 would come out.

I am by far experimenting.
I have now a problem trying to do the following:

I created a parent directory named demo-parent-project
inside it I created 'helloworld-portlet' portlet which has one Spring Web MVC Portlet definition, then Inside it I created another portlet named 'searchmoviegallery-portlet' and referenced it in portlet.xml (code follows).

<?xml version="1.0"?>

<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
version="2.0">
<portlet>
<portlet-name>helloworld</portlet-name>
<display-name>Hello World</display-name>
<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/spring/helloworld-portlet.xml</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
<title>Hello World</title>
<short-title>Hello World</short-title>
<keywords>hello world, liferay, El Colombiano</keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
<portlet>
<portlet-name>searchmoviegallery</portlet-name>
<display-name>Search Movie Gallery</display-name>
<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/spring/searchmoviegallery-portlet.xml</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
<title>Planepoly Search Movie Gallery</title>
<short-title>Planepoly Search Movie Gallery</short-title>
<keywords>Planepoly, Widget, Movies, El Colombiano</keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
</portlet-app>

and the same for Liferay specific artifacts. I am using Spring Web MVC with annotations, and one mapping is then ambiguos. Well, I will thereby open a new forum entry on this aspect.

Thanks.
thumbnail
Carlos Adolfo Ortiz Quirós, modificado hace 10 años.

RE: Liferay 6.1.x Maven Support (Respuesta)

Junior Member Mensajes: 40 Fecha de incorporación: 22/05/10 Mensajes recientes
After a little research and having followed the User's Guide Maven chapter. I could complete this task.
I wanted to write a Spring MVC Portlet using annotations and also to have at least two portlets in one WAR.

I wrote this in this forum: LIferay Porlet Spring MVC full portlet example (with Maven) and you can follow that link to know how I got it working.

Thanks.