Alex
Alex

Reputation: 883

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).

Upvotes: 5

Views: 2180

Answers (1)

Alexander Fedyukov
Alexander Fedyukov

Reputation: 974

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.

Upvotes: 1

Related Questions