Skip to content

Fixed EAR devc loose config context root - #1108

Merged
venmanyarun merged 3 commits into
OpenLiberty:mainfrom
sajeerzeji:fix/multi-module-project-dir-fix
Sep 10, 2026
Merged

venmanyarun merged 3 commits into
OpenLiberty:mainfrom
sajeerzeji:fix/multi-module-project-dir-fix

Conversation

@sajeerzeji

@sajeerzeji sajeerzeji commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

When running libertyDevc for a multi-module EAR project with looseApplication = true, Liberty ignored the configured context root and fell back to using the WAR filename instead.

The root cause was that DevTaskUtil always passed projectDirectory (the EAR subproject directory) as both projectDirectory and multiModuleProjectDirectory in the super() call to DevUtil, causing the container to mount only the EAR subproject as /devmode. But installLooseConfigEar() was already writing loose config paths relative to the root project directory, so all paths inside the container had an extra subproject segment that didn't exist. Meaning Liberty could never find application.xml and its context root mapping.

It now calculates multiModuleProjectDirectory as the root project directory when packaging is EAR and passes it to DevUtil, aligning the container mount with the path substitution root so Liberty can resolve all loose config paths correctly.

I have added IT to test this and also manually tested, the result is as below

  1. The browser showing localhost:9090/guide-gradle-multimodules-custmm-war-1.0-SNAPSHOT/: "Context Root Not Found", thus the WAR filename URL no longer works as a fallback
image
  1. The browser showing localhost:9090/converter/: "Converter, Context root is working correctly."
image

And from the terminal logs,

[AUDIT   ] CWWKT0016I: Web application available (default_host): http://32c7e762d2bf:9090/converter/

And all the devc tests are passed

image

@venmanyarun
venmanyarun merged commit a9e920a into OpenLiberty:main Sep 10, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants