1

I have a multi-module java / maven application that I'd like to run on openliberty in dev mode (mvn liberty:dev). The application is structured as follows:

root 
\ejb
\ear

OpenLiberty is looking for dependencies in the \ejb\target\classes folder on application startup but not finding the dependencies because they are not there. However, they do exist in the \ear\target\classes folder.

I think liberty should be looking in \ear\target\classes for its dependencies. This is because the maven build compiles them into the ear, not the ejb jar.

I assume the correct fix for this is to tell liberty (somehow) where to find the application dependencies (that live in \ear\target\classes not \ejb\target\classes).

Does this sound like the correct fix and does anyone know how to tell liberty to look for the dependencies in the correct location?

As a side note, I am getting the message

[WARNING] CWWKM2179W: The application is not defined in the server configuration but the POM configuration indicates it should be installed in the apps folder. Application configuration is being added to the target server configuration dropins folder by the plug-in. 

On openliberty startup.

This is even though the absolute path to the ear file is specified in server.xml in the ear file like so:

<enterpriseApplication id="my-app"
        type="ear" location="C:\Users\ absolute path to my app"
        name="my-app" contextRoot="/" />

I am additionally wondering if this log warning might be related to the trouble I'm having.

Here is an example of the messages I am getting on startup:

[INFO] [WARNING ] SRVE9967W: The manifest class path myjar-SNAPSHOT.jar can not be found in jar file file:/c:/my-app/ejb/target/classes/ or its parent.

If it looked in

file:/c:/my-app/ear/ 

I think I'd be good.

John Deverall
  • 5,954
  • 3
  • 27
  • 37
  • I think we'd need more info to help. ( I didn't downvote it personally though). Can you recreate in a simplified sample? Or, if not, share the basics of your POMs across the multiple modules: (top-level, EAR, EJB JAR) - especially including dependencies, and config for the plugins: EAR, EJB plus liberty-maven-plugin, and also including server.xml. – Scott Kurz Jan 11 '23 at 14:29
  • Or..if this is too much information to gather for a StackOverflow issue you could open an issue on the liberty-maven-plugin: https://github.com/OpenLiberty/ci.maven/issues – Scott Kurz Jan 11 '23 at 14:35
  • Just looking this over again. It doesn't seem typical to have content in your EAR target/classes directory. EARs contain other module archives (and the EAR descriptor). Are you sure that's what you intended? – Scott Kurz Jan 12 '23 at 12:04

0 Answers0