Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple maven pom.xml files

I have an Eclipse project with a GWT client and a Restlet API. I normally use Maven for dependency management but I havent used it in an Eclipse project where seperate parts have seperate dependencies. For example - the client would use Google Gin for dependency injection and the server uses Google Guice.

Am I able to split it into two seperate pom.xml files to manage the dependencies of both seperate areas?

Thanks

like image 270
christophmccann Avatar asked Nov 13 '10 23:11

christophmccann


People also ask

Can we have 2 POM xml files?

two pom. xml files are present in the same directory. some of the dependencies in the pom files are for the same artifact, but different versions.

Can a Maven POM have 2 parents?

You can achieve multiple inheritance with profiles: This is not ideal because child projects cannot control the activation of profiles defined in the parent POM. This is not remotely related to inheritance. But you can use them to setup some parameters to turn on/off with a switch (enabling/disabling the profiles).

Can two Maven modules depend on each other?

Because modules within a multi-module build can depend on each other, it is important that the reactor sorts all the projects in a way that guarantees any project is built before it is required. The following relationships are honoured when sorting projects: a project dependency on another module in the build.


1 Answers

You can create a multi module project. See examples here and here and here.

like image 78
CoolBeans Avatar answered Oct 06 '22 00:10

CoolBeans