Use Maven profiles: * compile only * compile/test only * compile/install jar only, skip source/javadoc packages * checkstyle only * static analysis only * code coverage only * Skip PGP (you DO check your artifact signatures, right?) The beauty of this is you can create a corporate super pom that defines all of these for you and they can be inherited by every project in your org. Finally, if you have a large multi-mod…
Alas, I'm stuck with Gradle. And not a simple example of the species, either.
I'm dating myself, but 20 years ago, we had Ant. It was very much a blunt hammer like CMake. Maven came along and was like "how about we choose a definitive way to organize projects, make that repeatable". You lose flexibility but gain speed/reuse.
I see Gradle more of a replacement for Ant than Maven in this regard. Infinite flexibility, at the cost of speed/reuse.