Foros de discusión

custom module jar dependency

thumbnail
Manikantha Rajamani, modificado hace 6 años.

custom module jar dependency

Expert Mensajes: 258 Fecha de incorporación: 25/03/14 Mensajes recientes
Hi Team

I have developed 3 modules called linckedIn-connect ,portal-setting-authentication-linkedIn-web,login-authentication-linkedIn-web

portal-setting-authentication-linkedIn-web, login-authentication-linkedIn-web
have dependency of linkedIn-connect
and i have added linkedin-connect dependency in portal-setting-authentication-linkedIn-web, login-authentication-linkedIn-web like below

build.gradle

dependencies {
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "2.0.0"
compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
compileOnly group: "jstl", name: "jstl", version: "1.2"
compileOnly group: "org.osgi", name: "osgi.cmpn", version: "6.0.0"
compileOnly group: "com.liferay", name: "com.liferay.petra.lang", version: "1.0.0"

compileOnly project(":modules:LinkedIn-connect")
compile group: "com.liferay", name: "com.liferay.portal.settings.web", version: "1.2.0"


}
bnb.bnb file
Bundle-Name: portal settings authentication linkedIn web
Bundle-SymbolicName: portal.settings.authentication.linkedIn.web
Bundle-Version: 1.0.0

Include-Resource: @com.liferay.portal.security.sso.LinkedIn.connect.configuration-1.0.0.jar,\

@com.liferay.portal.settings.web-1.2.0.jar,\



Liferay-Releng-Module-Group-Title: Portal Settings
Web-ContextPath: /portal-settings-authentication-linkedIn-web

when i add following code and deploy i'm getting 3 times instance settings in controlpanel

Is it correct way to add dependency or any other way we need to add for custom module

any one know how so solve runtime dependency plz share
thumbnail
David H Nebinger, modificado hace 6 años.

RE: custom module jar dependency

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Manikantha Rajamani:
Include-Resource: @com.liferay.portal.security.sso.LinkedIn.connect.configuration-1.0.0.jar,\
@com.liferay.portal.settings.web-1.2.0.jar,\


What are you doing? You don't need to include OSGi-compatible jars into the module, that actually leads to class loader errors. Liferay jars especially, those should never be added as a resource.

If you find yourself including a Liferay jar as a resource, that is a clear flag that you are absolutely doing something wrong.

You're building OSGi modules. Just deploy them as OSGi modules and let the OSGi container sort them out.