In a fairly large project I’m working on the team has the desire to split the public interface of subprojects (the set of interfaces and classes that should be usable by other subprojects) off from the implementation portion that should be considered private. This would be as an alternative to using the Java module system since that proved to be more hassle than it’s worth.
One approach to this is to split each subproject into two subprojects: an api and an impl subproject. The impl subproject has a dependency on the api subproject, consumer subprojects depend on the api subproject as well and one bootstrap subproject depends on the impl subproject to instantiate the implementation parts.
That works, but it’s rather cumbersome since it leads to an explosion of subprojects.
An alternative would be to use multiple source sets and published artifacts to do the same thing. I found an old forum thread describing that approach with a pointer to an example here What's a good pattern for separating API from implementation? - #10 by luke_daley. Unfortunately the link to the sample is dead and I wasn’t able to find a commit in the git repository around the date of that post either. Is that sample still available somewhere? Or is there a simpler solution for the problem I described in the meantime?