Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Circular dependency issue
I am using Liferay 7.3.7 ga8. I am wondering how to best approach the following:
- I want to extend a module (e.g. social-activities-web)
- I created my own module e.g. my-social-activities (**). My module needed some internal classes from social-activities-web. So I used fragment to export the internal classes. (*)
- After defining new implementation of my-social-activities e.g. NewSocialActivitiesDisplayContext. I once again need to change the fragment and e.g. add lines of code in init-ext.jsp (***).
The problem is when I run gradlew clean deploy, it seems that there are circular dependencies issues. My module, social-activities-web and fragment started and stopped all the time. I think the problem is the following: My module depends on internal classes aka fragment, but then the code in init-ext.jsp depends on my module and seem to lead to circular dependencies issue. Is there a better way to implement this? I am quite new to liferay and thanks in advance.
Circular dependencies are typically resolved through introducing a third module, on which both previous modules depend. This way, the dependency is unidirectional.
If you absolutely object to add another module, you can also merge the two current modules into just one.
Which of the solutions is best depends on the size of both and your future plans with the module(s)
Powered by Liferay™