Liferay Workspace with Intellij and Targetplatform?

Idryss Bourdier, modified 5 Years ago. New Member Posts: 3 Join Date: 1/10/20 Recent Posts
Hello,

In my company we have a project using Liferay DXP. I decided to use Intellij and I was glad to found out there is a nice plugin to manage Liferay Workspaces. Everything is fine until I want to debug my code using the Liferay sources ...

To be precise ; I can't manage to link Liferay src to my workspace, resulting in hard debug. When I search for a Liferay class, it shows me the Gradle dependency source code rather than the Liferay source code.I wanted to fix that by implementing the Targetplatform feature. I read this article https://portal.liferay.dev/docs/7-0/tutorials/-/knowledge_base/t/managing-the-target-platform-for-liferay-workspace#managing-the-target-platform-for-liferay-workspace and since I am using a Liferay workspace, I added ;

target.platform.index.sources=true

liferay.workspace.target.platform.version=7.1.10.fp11


To gradle files. But it doesn't work... It take a long time to gradle to execute the "Configure build" task and very often I ran into memory issue during the process. And of course, I still can't access Liferay source...What can I do? Am I doing this right or wrong? Is it possible to properly configure Intellij to read the Liferay source when I want to debug a class using them?

Thanks a lot!
Cheers.
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Those are the right settings, you just need to git the process time to run and give it the memory resources it needs.
Idryss Bourdier, modified 5 Years ago. New Member Posts: 3 Join Date: 1/10/20 Recent Posts
Hi,

Thanks for the reply. I tried again with a new and vanilla Liferay workspace project and it seems to work a bit more. The target platform config is working as for dependencies versions ... But still, all Liferay classes are linked to their gradle dependencies (aka : in the .gradle/cache folder). But I am wondering ; does it matter? If with the target platform feature I am now sure that my gradle dependencies versions are aligned correctly with the target liferay version, I can debug fine I guess? There will be no mismatch anymore?
thumbnail
David H Nebinger, modified 5 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
When you specify a target platform such as 7.1.10.fp11, all of the Liferay dependency versions will be the ones that ship with that FP.  So if you have selected fp11 but you are trying to run against fp5 or fp25 (if it ever exists), you'll get messages about versions not matching the environment.
Amos Fong, modified 5 Years ago. New Member Posts: 3 Join Date: 1/10/20 Recent Posts
I don't have any message telling me about mismatch so, I guess it's fine then. My only question was if it was "normal" that the IDE is showing me the sources in the gradle folder but, if I am sure that the versions are matching, it's not a problem anymore.

​​​​​​​Thank you very much!