Good approach of a maven project design or antipattern design

☆樱花仙子☆ 提交于 2019-12-06 07:45:40

To me, your approach looks like an antipattern. I recommend to only have projects in the same hierarchy that you want to release together. Projects with a different release lifecycle should live on their own - otherwise you will keep running into the issues you mentioned. If you run the release plugin from a root directory (multi-module setup), all of the content of that root directory will be tagged in SVN.

In your case, I would probably create the following hierarchies:

  • Core
  • One per customer type
  • Potentially one per type to bundle them (zip), depending on your structure

I would group it by the way you create the release. It might mean that you have to run the release plugin a couple of times instead of just once when you make a change e.g. in Core, but it will be a lot cleaner.

Your packaging project will then pull in all of the dependencies and package/assemble them.

If you have common configuration options, I recommend to put them into a common parent pom. This doesn't have to be your root (multi-module) pom.

Did you try to run the maven-release-plugin with -r argument + the list of all modules you want to release?

Basically, this argument allows you to specify the list of modules against which the maven command should be performed. (if you omit it: all submodules will be included, this the default behavior)

See more details about this command line here.

I never try to use it with the maven-release-plugin, and I don't know if it will work, especially regarding SCM operations.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!