Loose EAR Manifest Class-Path Issue Fix#1073
Conversation
…ifest, Adds that dependency's class and resource directories to the module archive element in the loose XML
venmanyarun
left a comment
There was a problem hiding this comment.
as discussed, add tests
…' into GH766-Multi_module_issue_with_loose_app
|
Hi @cherylking Previous approach was to use manifest Class Path entries to determine dependencies, requiring users to manually declare Class-Path in their build.gradle files. This approach was reverted after cross-checking with Maven plugin implementation. Added
Now the plugin automatically detects project dependencies from Gradle configurations, for each EJB/JAR module, it finds all project dependencies, adds dependency class directories as |
|
@sajeerzeji |
Screen.Recording.2026-04-13.at.4.29.14.PM.mov |
|
Looks like most of the builds are failing. So I am not going to look at the changes further until they are passing. |
Test are passed once re-ran, the issues where network connection timeout in InstallLiberty_runtimeUrl tests. |
Fixes #766
Issue
The application failed to start in loose EAR mode with,
In packaged EAR mode, JAR files are physically present in the EAR, and Liberty's classloader uses the manifest Class-Path entries to locate dependency JARs within the EAR.
In loose EAR mode (looseApplication = true), there are no physical JAR files. Instead, the plugin generates an XML descriptor (GarageSaleLibertyEAR.ear.xml) that maps source directories. Liberty's classloader needs to know which class directories belong to each module.
The Problem
compileOnlyorimplementationdependenciesPrevious Approach (Reverted)
The previous fix attempted to use manifest Class-Path entries to determine dependencies, requiring users to manually declare Class-Path in their build.gradle files. This approach was reverted after cross-checking with Maven plugin implementation.
Current Approach
Added
addDependencyClassDirectories()method that,compileClasspathandruntimeClasspathfor project dependenciesHow it works
<dir>elements in the loose XMLUsage Requirements
No special configuration needed. The plugin automatically handles dependencies declared in build.gradle.
Backward Compatibility
looseApplication = false) continues to work unchangedTesting
Added a new test
TestMultiModuleLooseEarEjbDependencythat verifiesBefore

After
