EAR Artifact with common classes

Hi all,

I would like to create an EAR-file that contains a web- and an EJB-module, both depending on some common classes. The common classes should be stored in aseparate jar.

In the project there are 4 modules - one for the EAR, web and ejb stuff - one for the common classes.

If I configure the web- and the EJB-module to be depending on the common modules with the scope "compile", I get an ear artifact, were the common classes are contained in the web and the EJB-modules compile output or artifacts.

If I configure the web- and the EJB-module to be depending on the common modules with the scope "provided", I get an ear artifact, were I can add the common as a separate artifact. But then I have to add the dependency to the web- and ejb-modules' manifests manually.

Is there an easier way for this task?

Thanks for any hints.

Please sign in to leave a comment.