y0dA
y0dA

Reputation: 53

Creating EAR with Maven

project structure:

domain project (containing Pojos/Entities)
service project (EJB project)
service client project (interfaces for service project)
web project
ear project
parent project (just containing parent pom)

How do I have to configure the different poms? Do I have to define dependencies like service project needs domain and service client project?

The structure of an generated EAR with Eclipse (export as EAR): target META-INF lib (containing ServiceClient.jar,Domain.jar) Service.jar (EJB project) Web.war pom.xml

How can I get this structure with Maven?

Upvotes: 0

Views: 1238

Answers (1)

TrueDub
TrueDub

Reputation: 5070

The Maven EAR plugin allows you to define the projects required in the various roles of your EAR. Have a look at the documentation. Naturally your sub-projects will need to refer to each other for compiling, but you can set their scope as provided to ensure you only get one copy of the jar in the built ear.

Upvotes: 2

Related Questions