I have a backend system that connects to a database. During development I'd like to provide an in-memory persistence implementation that doesn't require a running database. In Android projects we can use build variants to have different binaries for different environments. This would allow me to build a jar for development purposes and one release jar.
Is there something similar for non-android projects?
There have been similar questions before but none of them provide up-to-date solutions. Please note that I do not want my final jar to contain the development implementation so a runtime switch is not an option.