RE: How to add local jar files in the project?

star boy, modified 7 Years ago. New Member Post: 1 Join Date: 10/7/18 Recent Posts

i am using  mvc-portlet module for my project in liferay 7.

I need to add some jar files to it which  i have added into the module by creating a folder inside.

i have made the required additions in the gradle.properties file.Still it is not getting deployed.when i tried to start it in the  gogo shell it is giveing import jar error

 

it showing Below Error : 

 

org.osgi.framework.BundleException: Could not resolve module: screener [687]
 Unresolved requirement: Import-Package: chemaxon.formats

 

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
star boy:

I need to add some jar files to it which  i have added into the module by creating a folder inside.

Is there a reason you've manually added them to a folder rather than referencing them as regular Maven dependencies?

Having them in a folder requires you to, at a minimum, do something similar to com.liferay.portal.osgi.web.wab.extender, where you declare the dependency as a fileTree dependency at compile time, and then you have to make sure the .jar is deployed to the OSGi container.

If those dependency .jar files aren't OSGi modules that declare exported packages, you'll also need an added step to embed the .jar into your generated module (probably with steps similar to this earlier post), which would have been handled for you automatically if they were compileInclude dependencies from a public/private Maven repository.