Fórum

How do I build a portlet on the latest IDE?

Iñaki Bergara, modificado 7 Anos atrás.

How do I build a portlet on the latest IDE?

Junior Member Postagens: 65 Data de Entrada: 30/10/11 Postagens Recentes
Hi,

I decided to take Liferay 7 for a spin and I set up the whole thing: liferay 7, java 8, the latest IDE bundled with eclipse neon. I created a workspace, created 2 modules in it (one mvc portlet and one for the service builder), and configured the build path of the mvc portlet to include the service builder project so I would have those classes available on the project module.

So far so good, but then came building time and I'm lost. I have 2 problems:

First, I assumed it would work similar to how I worked on liferay 6.2, where I would build each project into a war file and then bring that to the server. However, when I execute the "assemble" gradle task under build on the right side of the IDE I get nothing. The wars folder is still empty, the only output I can find is a .jar which is certainly not what I expected. How do I produce a .war? Or, does liferay 7 deploy differently?

Second, and this is probably more eclipse related, while the service classes are indeed available on the portlet while developing, they seem to be missing once I execute the "assemble" task. I assume I need some extra configuration to make this work, rather than manually having to build the jar for the services and copy it into the libraries of the portlet. How is this done?

I looked for tutorials on these issues, but I couldn't find any. If I missed them, I'd appreciate it if you could point me their way.
Thanks.
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: How do I build a portlet on the latest IDE?

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Iñaki Bergara:
First, I assumed it would work similar to how I worked on liferay 6.2, where I would build each project into a war file and then bring that to the server.


That's your first mistake. For Liferay 7 CE/Liferay DXP, we now build modules which are OSGi-enabled jar files only.

The right command for gradle, though, is to use the build task.

The wars folder is still empty, the only output I can find is a .jar which is certainly not what I expected. How do I produce a .war? Or, does liferay 7 deploy differently?


The jar file is the only thing you'll get, just drop the jar files in the deploy folder and all will be fine.

Second, and this is probably more eclipse related, while the service classes are indeed available on the portlet while developing, they seem to be missing once I execute the "assemble" task. I assume I need some extra configuration to make this work, rather than manually having to build the jar for the services and copy it into the libraries of the portlet. How is this done?


For gradle you just have to have the right dependency listing. Usually this is something like:

compile project(':modules:service-builder-project:service-builder-api')


If I missed them, I'd appreciate it if you could point me their way.


Blade samples is a good place to start: https://github.com/liferay/liferay-blade-samples
Iñaki Bergara, modificado 7 Anos atrás.

RE: How do I build a portlet on the latest IDE?

Junior Member Postagens: 65 Data de Entrada: 30/10/11 Postagens Recentes
If I'm OK with the jar files, then I did found that, so I should be OK. Thanks. I now wonder why it creates an empty "wars" folder on the workspace, but whatever, I can look it up later.

I'll check that link out. Thanks again.
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: How do I build a portlet on the latest IDE?

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
That wars folder is for building war-based projects. See my latest blog on creating a Spring MVC-based portlet war project.
thumbnail
Jennis Vaishnav, modificado 7 Anos atrás.

RE: How do I build a portlet on the latest IDE?

Junior Member Postagens: 59 Data de Entrada: 01/02/17 Postagens Recentes
David H Nebinger:
See my latest blog on creating a Spring MVC-based portlet war project.



Share your blog link please!