Collapsing parent POM into the child

后端 未结 3 884
半阙折子戏
半阙折子戏 2021-02-09 21:44

Given a maven project with a parent POM - including mostly plugin and dependency versions - how can I generate a POM which takes the information from the parent, places it into

3条回答
  •  隐瞒了意图╮
    2021-02-09 22:34

    If you don't want a parent you can try the BOM (Bill of materials) pattern and select that pom for import in your dependancy management section.

    Since you want no references to anything else, you will need to build an app to parse the xml from the "parents" and then write them to the target pom file in the dependencies section. I don't think there is any plugin to do what you want since it seems to go against the very core of how maven is supposed to help you. The whole point of maven is so that you can include all your dependancies using inheritance or importing them with the import scope.

    Another option, but I think you've excluded it, is to maintain your releasable POM file separately. Though I think you may find an easier time with this if you reference LATEST or SNAPSHOTS and then use the release plugin to resolve them to released versions.

提交回复
热议问题