Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building/deploying a EJB .jar with its dependencies

I am new to Java EE. I use Maven, Eclipse and jBoss/WildFly.

I have a war project. When I build the project all its dependencies are packaged inside the war file in WEB-INF/lib.

Now I am trying to create a ejb project (I have <packaging>ejb</packaging> in the pom.xml). I want to deploy it as a separate project (not as a part of the war). When I build the ejb project Maven does not package any dependencies in the jar.

How can I package/deploy a ejb .jar with its dependencies?

UPDATE: I'd like to avoid packaging EJBs in an .ear if it is possible. (I do not want to create one more Maven project).

like image 427
Alex Avatar asked Nov 09 '22 18:11

Alex


1 Answers

The best solution is package your project as ear. But if don't want use ear, maven assembly plugin can help you to package all needed jars in one file. This solution is only for "proof of concept" variant, and cannot be used in production mode, by licences limitation for example.

like image 155
Alexander Fedyukov Avatar answered Nov 15 '22 07:11

Alexander Fedyukov