掲示板

Using custom service in OSGi module in Liferay 7 GA3

7年前 に Alex Voronin によって更新されました。

Using custom service in OSGi module in Liferay 7 GA3

New Member 投稿: 17 参加年月日: 13/02/07 最新の投稿
Hi, everyone!
I'm using Liferay 7 GA3.
I have a custom liferay portlet with a service. Now I'm trying to create a new OSGi module. In this module I want to use service from custom portlet. I tried options 1 and 2 from this article . But when I compiling my module with gradle, I've get an error: package com.customportlet.service does not exist. It seems to me, I need to specify some dependencies or path to my liferay folder, but I don't know how.
thumbnail
7年前 に David H Nebinger によって更新されました。

RE: Using custom service in OSGi module in Liferay 7 GA3

Liferay Legend 投稿: 14918 参加年月日: 06/09/02 最新の投稿
If you are using a LR workspace, then you use your "compile project(':modules:service')" sort of format.

If you are not using a workspace, then your other project needs to install the jar into your local repo or publish to a nexus-like system.

This will make the project available for compile-time usage which is where your compile failure is occurring.

The blog is for runtime dependencies (deployment failures), not compile time issues.
7年前 に Alex Voronin によって更新されました。

RE: Using custom service in OSGi module in Liferay 7 GA3

New Member 投稿: 17 参加年月日: 13/02/07 最新の投稿
Thanks for your reply.
I'm using LR workspace, but my custom portlet is not a module project, it is a plugin project. How do I connect it in this case?
thumbnail
7年前 に David H Nebinger によって更新されました。

RE: Using custom service in OSGi module in Liferay 7 GA3

Liferay Legend 投稿: 14918 参加年月日: 06/09/02 最新の投稿
Hmm, I don't know if that is really supported, but it is really not something that I have tried.

I would not recommending mixing legacy and module together though. If you're going to bite the bullet and start building modules, then build modules and discard the legacy api. After all it is really only there for backwards compatibility with your existing Liferay plugins but is not intended to be used for new development.
7年前 に Alex Voronin によって更新されました。

RE: Using custom service in OSGi module in Liferay 7 GA3

New Member 投稿: 17 参加年月日: 13/02/07 最新の投稿
I began to develop the modules, but I need the service of the old plugin portlet. I can try to move the service to the new module, but will all other plug-ins which are also using this service work correctly?
thumbnail
7年前 に David H Nebinger によって更新されました。

RE: Using custom service in OSGi module in Liferay 7 GA3

Liferay Legend 投稿: 14918 参加年月日: 06/09/02 最新の投稿
When you build the service in the new sdk you should get an api jar, but this is actually an osgi bundle that you can use in your regular modules.

The challenge of course is how you access the jar at compile time for the module build. It may be easier to install into your local repo and then reference as a regular dependency in your module.

The runtime dependency should not be an issue; the bundles will be deployed and available. You just need to figure out the compile time dependencies.
7年前 に Alex Voronin によって更新されました。

RE: Using custom service in OSGi module in Liferay 7 GA3

New Member 投稿: 17 参加年月日: 13/02/07 最新の投稿
I solved the problem. Thank you!
7年前 に Thirumal Reddy によって更新されました。

RE: Using custom service in OSGi module in Liferay 7 GA3

Regular Member 投稿: 216 参加年月日: 15/12/03 最新の投稿
Hi Alex Voronin,
How did you solved the problem.
could you please elaborate..

Thanks..