> Ok, so here a the dirty details. The main project is a Tibco project. > Technology is not really relevant, but the point is that such a project can > be used to develop/build several artifacts.
Yes, that is dirty and very much not the Maven way. > One thing that comes to mind is to make > one artifact per project and this is actually a long term goal but "as is" > situation is that we have several artifacts per project. IMO you should do this asap. It will make your life so much easier as it is the Maven way. One Maven project has one primary artifact. Sure, it may have additional artifacts, but they all share the same pom which make them all have the same dependencies. In normal cases, two artifacts do not have hte same dependencies so you will run into issues if you don't refactor. I very often struggle with this type of issue when helping projects that fight the Maven way. IMO, it would have been cheaper to do it right from the beginning (i.e. refactor) than trying to go around Maven (including all different strange and bad workarounds) or eventually refactor anyways. Trust me on this one. > One idea that I have now is to use iteration that Maven does over modules > to > make each artifact update the main project dependency file based on its own > pom content. > No. A Maven project should be self-contained. It should not "walk the file directory tree" and update/create files outside the project. If you do this you loose the possibility of just checking out one project and build it on its own. What I think you should do is create a separate module, which has dependencies to all other projects. In that project you bind your plugin that will iterate over all the dependencies and get the transitive dependencies and create this union of dependencies you're talking about. IMO, that's the Maven way. I kind of see a similarity to how many of the goals of the dependency plugin work. /Anders > > Greetings, > Tomasz > > -- > View this message in context: > http://maven.40175.n5.nabble.com/How-to-collect-module-dependencies-in-a-Java-Mojo-in-a-parent-project-tp3381251p3381421.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
