RE: What do i need to do if i want to add a custom maven dependency?

Erik Galliani, modified 3 Years ago. New Member Posts: 4 Join Date: 2/23/21 Recent Posts

Hi, 

i would like to add a custom maven dependency in a portlet used in Liferay 7.4. 

Im migrating from Liferay 6.2 to Liferay 7.4 and I cannot use this Library on this newest Liferay.

What do i need to do on the pom.xml file in order for Liferay 7.4 to load this jar Library?

Thanks in advance

 

 

thumbnail
Jamie Sammons, modified 3 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

If that dependency is an OSGi bundle, you should deploy it to the runtime just like your own plugin.

If it's not, and it's Open Source: Check if you can find it somewhere converted into an OSGi bundle or consider doing the work yourself and try to push it upstream.

If you can't make it a bundle, you might need to bundle its code within your own plugin. In Liferay Workspace (gradle-based), this is called "compileInclude" - I can't give you the exact recipe for Maven.

Jamie Sammons, modified 3 Years ago. New Member Posts: 4 Join Date: 2/23/21 Recent Posts

thank you very much, i could make my maven project an OSGi Bundle and deploy it. Unfortunately this bundle consists of more dependencies. And some of those dependencies arenot OSGi Bundles. Ill try with gradle