You can use Submodules here :- Parent Module having two sub modules 1. PathFactory packages 2. Main project codeSimply comment out the submodule which you are not deploying in the Parent Module POM.By this way you will have single pipeline which manages both sub modules, separate pipeline removes ...