My project is spanned across two phases. First phase is nearly completed. Although we already have some functionality, that can be seen as menu items for logical separation, developed which is to be delivered in phase two.
I have been advised to maintain two versions of the codebase (creating two branches phase1Branch and phase2Branch). That is because we need two compiled (it's java therefore deployed artifact is a jar file. I use jenkins to build the project that generates the jar file for deployment.) versions of the codebase one for phase1 and another for phase2. So that it can be easily switched from phase1 to phase2 as and when required, for instance while showing a demo to the client.
However, I still think this can be done without maintaining two codebases.
What is the best practice that serves the objective with minimum hassle?