Maven: Build selected projects

I was surprised when I re-discovered that feature in maven a few days ago. You don’t need to read any further if you constantly use this feature, but those who don’t know about it may find this useful. In fact I never have a dire need in a “partial build” feature, but still it is very nice to have in multimodular maven project especially with multiple heavy projects.

So, in short: in multimodular maven project you can build the selected artifacts without the need to rebuild all again.

Here is how we can do it by sample – the following snippet tells maven to build two projects: myproj-domain and myproj-service without running tests:

mvn install -pl myproj-domain,myproj-service -DskipTests=true

Leave a Reply

Your email address will not be published. Required fields are marked *