maven: generating several “artifacts” with a same pom file?

后端 未结 4 1934
栀梦
栀梦 2021-01-04 11:30

I have a project here which, currently, uses one pom.xml (link) to generate one \"artifact\".

What I\'d like to do is split the project, let\'s call it p, into:

4条回答
  •  借酒劲吻你
    2021-01-04 11:49

    Your life will be much easier if you simply break out p-format into a separate project that depends on p-core.

    Although there are ways to publish multiple artifacts per project, Maven is designed around one artifact per pom/module (plus test artifacts). From experience, clever attempts to work around this design point will end up biting you eventually - usually in the form of an issue 6 months down the road where packaging won't work properly on someone's machine.

    The scenario you describe fits well within the multi-project use case, and I'd suggest you go with the flow and make your future self happy.

提交回复
热议问题