liferay-portal-source

Navigate, search, and modify the Liferay Portal source code from a dynamically resolved local checkout.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/gweone/agent-plugins --skill liferay-portal-source-gweone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: liferay-portal-source
Source: https://github.com/gweone/agent-plugins/tree/main/plugin/sharpps-liferay/skills/liferay-portal-source
Command: npx skills add https://github.com/gweone/agent-plugins --skill liferay-portal-source-gweone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with the Liferay Portal codebase is hard because it is huge, version-dependent, and never at a fixed path. This Skill resolves the correct source checkout for each session, orients on the version-specific layout, and provides proven search patterns and build commands so questions about modules, portlets, OSGi components, and Service Builder entities get answered against the real code. ## Core Features & Use Cases - Dynamic source resolution: Locates the liferay-portal checkout as a sibling of the current workspace, asks before using an alternate path, and bootstraps a shallow single-commit clone only after user confirmation. - Codebase navigation patterns: Provides find/grep recipes for locating classes, portlets, OSGi @Component registrations, Service Builder service.xml entities, and configuration properties across modules/, portal-impl/, portal-kernel/, and portal-web/. - Build and customization guidance: Maps Ant vs Gradle build commands, deploy/buildService/formatSource tasks, and a cheat sheet for common tasks like adding portlets, overriding services, and adding entities. - Use Case: A developer asks "how does Liferay implement asset rendering for Documents?" The Skill resolves the checkout, identifies the version, searches modules/apps/document-library for the relevant AssetRendererFactory, and explains the implementation with file references. ## Quick Start Ask the assistant to find how a specific Liferay feature is implemented in the portal source, for example where a given portlet or service class lives.

Frequently Asked Questions about liferay-portal-source

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find a class in the Liferay Portal source code?

Use find with the class name against the resolved source root, for example find "$LIFERAY_PORTAL" -name "ClassName.java". Partial names work too, such as find with -name "*Journal*Service*.java" to locate service classes.

How do I locate a portlet in the Liferay codebase?

Search modules/ for the portlet's display name in .properties files or for its javax.portlet.name property in Java @Component annotations. Grepping for "javax.portlet.name=" with a keyword filter narrows results to the owning bundle.

Does Liferay use Gradle or Ant for building modules?

Both. OSGi bundles under modules/ build with Gradle via ./gradlew deploy, while the root, portal-impl, and portal-web use Ant targets from build.xml. Always use the ./gradlew wrapper rather than a system Gradle install.

Why should I not edit generated Service Builder classes in Liferay?

Classes prefixed with Base in *-service modules are regenerated by the buildService task, so edits are overwritten. Make changes only in *LocalServiceImpl.java or *ServiceImpl.java, which are the designated extension points.

Can I use this with a Liferay DXP checkout instead of Community Edition?

Yes. The Skill resolves whatever liferay-portal checkout exists, and DXP trees add enterprise modules under modules/dxp/ and modules/private/. Orientation via release.properties identifies the exact version before any search or change.

Why does the Skill avoid a plain git clone of liferay-portal?

The upstream repository has over ten years of history and a multi-gigabyte .git directory. The Skill instead fetches with --depth=1 and squashes into a single local commit, giving the current source tree without downloading the full history.