I would like to ask you for help with following issue.
Consider 3 projects A, B, C. Projects B and C are standalone modules (resulting in jar). These projects Bcan live by their own. Project A is somehow specific in way, that I need it to behave as module (for project B, C) parent. When I build project A, I need to build B, C too. Hovewer, Project A has sources of it’s own, and when I build it, I want it to result in jar file too.
This is somehow contradictory in maven world, as far as my knowledge goes. I simply need my parent pom to manage modules, while having it declared with jar type.
So far, I’ve not been able to find any resources on how to manage this, so hopefully, You guys will bring some ideas up. Thanks in advance.
This is a violation of the Single Responsibility Principle. Either Project A should be an aggregator or it should result in an artifact after a build. So you should factor out the sources of Project A into a project D and let B and C depend on D.
If you insist in inheriting a dependency on the sources current contained in A then i suggest you should create another Project E. The hierarchy then should look like:
The new aggregator E should then have a dependency on D.