DxpLife The practical Liferay DXP knowledge hub
Talk to us

Home/Field Guide/Platform foundations

CONCEPT 02

Workspace, Blade, and local setup

Set up a target-aligned development workspace and build reproducible artifacts.

8 minVerify target JDK

Make the target explicit

Liferay Workspace is a Gradle project layout and a set of plugins for building bundles, assembling client extensions, and managing a development runtime. Blade CLI can scaffold Workspace and supported project templates. Check in the Gradle wrapper and pin compatible tooling so everyone builds against the same target. Use the supported liferay.workspace.product key for the chosen build, as listed in Workspace configuration. Select its matching Portal or DXP API artifact and dependency target.

Set up a repeatable loop

  1. Record the edition, exact build or container image tag, JDK, Workspace plugin, and Gradle wrapper.
  2. Start an isolated Liferay instance with a disposable database for experiments. Wait for startup and confirm the build before deploying.
  3. Put Java modules under modules/ and client extension projects under client-extensions/. Keep environment-specific settings separate from shared defaults.
  4. Compile and deploy one project at a time. Read the runtime log and test through the UI or API as a normal user.
  5. Promote the resulting versioned artifact through CI. Inject secrets at runtime.

Read the build outcome

bash
./gradlew projects
./gradlew :modules:hello-command:build
./gradlew :modules:hello-command:deploy

These commands assume the project path listed by projects is :modules:hello-command and Workspace is configured for local deployment. Use gradlew.bat on Windows. A successful build shows Gradle could compile the artifact. A successful deployment also requires the runtime to install the bundle, resolve imports, and satisfy component references.

Diagnose a mismatch

If the same source builds locally but fails in QA, compare the image digest and exported package versions before clearing caches. If Java reports a class-file version error, check the runtime JDK against the build JDK and compiler target. If Gradle finds the API but the bundle fails at runtime, compare the exact artifact target with the running distribution.

Official references