I have a Gradle project that builds services, i.e. service api classes and service implementation classes. I now want to separate the api classes from the implementation classes. What is an ‘elegant’ and suggested way to do this with Gradle?
I have the following requirements: - have a jar that contains only the service api classes (and no dependency on implementation classes) -> classifier api - have a jar that contains only the implementation classes (and a dependency to the api classes) -> classifier impl - have a jar that contains both api and implementation classes (that’s what I currently have) -> no classifier - upload all three jars to the the same Maven repo location (their names differ only by the classifier)
Thoughts: - should I have an additional configuration like mainApi? (could I then still have other Gradle projects depend on just this mainApi configuration?) - should I have another project with just the services? (but then how to do the upload of the three jars to the same repo location?)