Foros de discusión

Is required-deployment-contexts required for Maven based project?

Jan Tošovský, modificado hace 8 años.

Is required-deployment-contexts required for Maven based project?

Liferay Master Mensajes: 566 Fecha de incorporación: 22/07/10 Mensajes recientes
Dear All,

I have several Maven based plugins. Some of them depends on others. In this case I specify the corresponding service dependency in the POM file (using compile scope). Is there any need to specify also required-deployment-contexts in the liferay-plugin-package.properties? Do I understand correctly it is for ANT based plugins only? It seems everything works fine now even without entries in properties file.

Thanks, Jan
thumbnail
Meera Prince, modificado hace 8 años.

RE: Is required-deployment-contexts required for Maven based project? (Respuesta)

Liferay Legend Mensajes: 1111 Fecha de incorporación: 8/02/11 Mensajes recientes
Hi
required-deployment-contexts specified that before you deploy current plugin we should deploy the dependent plugins and this case specially we can see when we share the services between the plugin portlets. some time if the dependent plugin not available then it show you in log message at the time of deployment.
If we build portlet using ANT then it will read this property and based on the value it will copy the required service jar into current portlet WEB-INF/lib it will be useful at the time of ANT build but in the MAVEN case we specified as dependency jar so it will be included at the time of packaging war. in this case it working fine even you did not specified property due to this you cannot see the message in log file even the dependent plugin not deployed in the server.
Regards,
Meera Prince
Jan Tošovský, modificado hace 8 años.

RE: Is required-deployment-contexts required for Maven based project?

Liferay Master Mensajes: 566 Fecha de incorporación: 22/07/10 Mensajes recientes
Hi Meera,

thanks for confirming. I agree that log message can be handy in certain cases even in Maven based projects.

My main reason for removing this dependencies metadata was circular dependency (deduced by Liferay from blind chaining of properties files) which prevented deploying several portlets. In reality it was just a false alarm.

Lesson learned - thanks to Maven I can break my code into smaller plugins with advanced relationships between them, which (in my current plugin structure) couldn't be deployed in case of ANT.

Jan
thumbnail
David H Nebinger, modificado hace 8 años.

RE: Is required-deployment-contexts required for Maven based project?

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
Wow, I can't tell if Meera was saying yes to use them or no to not use them...

But yes, you should use required deployment contexts when needed. Required deployment context has nothing to do with dependency management, it has to do with plugin startup management handled by the portal.

If plugin A is dependent upon plugin B, then Liferay will ensure that B is up and running before A starts. Dependency in this respect is dependency on runtime beans, not on compile time code.

It sounds like you're also mixing in the concept of the portal dependency jars. Here you still want to use this also, even under ant. At deployment time, Liferay will copy in it's own jars into your war file. The benefit of this is twofold - first you get the same version of the jar that Liferay is using (maximizing compatibility) while at the same time shrinking the size of your deployable war.

For each jar you list as a portal dependency jar you still need to add the dependency to the pom, but you use the "compile" scope so as to not include the jar in war build.
thumbnail
Meera Prince, modificado hace 8 años.

RE: Is required-deployment-contexts required for Maven based project?

Liferay Legend Mensajes: 1111 Fecha de incorporación: 8/02/11 Mensajes recientes
HI
David H Nebinger
You are right and thanks for the information you have given..emoticon


Regards,
Meera Prince