I have a legacy project and I want Gradle to work with it without having to change the way my project is structured. My project needs to output two artifacts, each with it’s own pom.xml. The second artifact uses a subset of the code and a subset of the dependencies.
Right now the best solution I have is to add an additional sibling subproject that duplicates the dependency declarations and specifies srcDir’s pointing at the original source, and include filters to select the subset I need.
The biggest downside here is that I’ve created a duplication of the dependencies, which is creating room for error and confusion in the future.
Without changing project structure, what’s the cleanest way to generate more than one artifact+pom.xml combination from a project?