Foren

How to resolve dependency of project B to project A in osgi ?

thumbnail
Shahbaz Khan, geändert vor 6 Jahren.

How to resolve dependency of project B to project A in osgi ?

Junior Member Beiträge: 40 Beitrittsdatum: 18.11.14 Neueste Beiträge
Hi I have a problem in dependency resolution in liferay dxp osgi module.My scenario is like:

I have a project A which have lots of dependency in its gradle file. It is taking arround 10 to 15 minutes to resolve or download these dependency, that is fine . Now i have a util class in project A which i want to use it in project B.

In project B, i have define dependency of project A like
compile project(":modules:project A")
Everytime when i build or deploy project B, it is also taking too much time to resolve dependency. Because first, it resolves dependency of project A then build project B.

So is there any other solution which reduce dependency resolution time of project B. Because i just want to use project A util class here.
thumbnail
David H Nebinger, geändert vor 6 Jahren.

RE: How to resolve dependency of project B to project A in osgi ?

Liferay Legend Beiträge: 14915 Beitrittsdatum: 02.09.06 Neueste Beiträge
When gradle downloads the deps, it keeps them locally so they don't have to download again.

If it is taking you this long it's kind of an indicator that you've been purging some of those caches?









Come meet me at Devcon 2017 or 2017 LSNA!
thumbnail
Olaf Kock, geändert vor 6 Jahren.

RE: How to resolve dependency of project B to project A in osgi ?

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
Shahbaz Khan:
I have a project A which have lots of dependency in its gradle file. It is taking arround 10 to 15 minutes to resolve or download these dependency, that is fine . Now i have a util class in project A which i want to use it in project B.


In addition to David's answer: this might be the perfect time to extract useful Util classes out of project A into its own project with less dependencies. With proper dependency-management you can prevent being dependent on a huge project just because you want to reuse a few lines of utils.

Project A and Project B would end up depending on that Util project.

Rinse & repeat. Sounds (to me) like your software grew to a size where worrying about the proper architecture has come.