Maven: Generate different wars from different prof

2019-09-01 03:22发布

问题:

I have a web application project. This project has different maven profiles (for countries and environments) with filtered properties. I have to execute many times to obtain the different wars but I would like to get all the wars in a single maven execution.

Is this possible?

回答1:

Maybe you can write scipt with all those maven commands



回答2:

It's not quite clear from your question, but if you simply want to "run" several profiles in one maven execution, it's as easy as

mvn -Pprofile1,profile2,... package

each with it's own WAR build execution.

Cheers,



回答3:

If you need multiple wars, Place different POM's in all the directories you want and configure the basic information needed.