Ant to Maven - multiple build targets

后端 未结 3 1053
时光取名叫无心
时光取名叫无心 2020-11-28 23:08

I have an Ant build that is currently being converted to Maven. However, the Ant build has 2 build targets - one that builds the entire app, and one that builds a JAR from s

3条回答
  •  时光取名叫无心
    2020-11-29 00:05

    You've got 2 choices:

    • Profiles
    • Assemblies

    If the subset is only a collection of resources, then I wouldn't make it a separate module.

    If the project is always dependent on the subset which is packaged in a uniform way, then the subset is a good candidate to become a module.

    If the subset is repackaged in multiple different "flavours", then I would define assemblies for each "flavour" and qualify the artifact names with a "classifier" see maven coordinates.

    Finally, you could use profiles to determine which assemblies get produced, your default profile may only create the initial artifact "flavour" that is required during development.
    A "full" profile may produce all "flavour" variants of the artifact for final deployment once development is complete.

提交回复
热议问题