Pregunta

I have a multi module project that keeps puzzling me. I have another 'war' project that imports this multi module pom project using

<type>pom</type>
but non of the transitive dependencies are included. Whenever I include the dependencies in the multi module 'pom' project using the

<dependencies>
...

section, I keep getting circular dependencies. It seems that whenever you use 'module' in your multi module 'pom' project, it includes the child modules as dependencies but it doesn't allow these dependencies to be transitive dependencies for projects that include this multi module 'pom' project. Is there a way to use

<dependencyManagement>
...

inside the 'pom' project that has sub modules and have the sub module dependencies pass to the projects that inherit from this pom?

¿Fue útil?

Solución

You are not expected to specify a multi-module pom as a dependency in your project. I guess this is the cause of the problems that you mention.

If you have a bunch of dependencies present in various modules of the multi-module pom that you need in your war project, you could explicitly specify these dependencies in your war project. In many cases, it maybe as simple as specifying just one or more dependencies, which in turn will bring in its transitive dependencies.

You may also want to read up on importing managed dependencies, which talks about using a bill of materials pom, which is possibly an alternate solution for your problem.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top