I have taken over maintenance of a project which is built with Gradle. Up to now it was just a Gradle plugin but we are currently refactoring it. In the future it should have a core module which is used by the gradle plugin module. Then there should be more consumers of the core, i.e., CLI, Maven, perhaps something with UI (Java FX based?).
First action was to clean up the build. If anyone has a little bit of time, I am happy if you take a look and give feedback as I have not actively used Gradle for a long time. Note that any recent changes are on the develop branch (not on main) and that develop is not yet the default branch.
However, I have a strange problem and no idea to fix it. When I publish to MavenLocal (from develop branch) I get the following files:
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.core/maven-metadata-local.xml
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.core/2.0.0-SNAPSHOT/org.aim42.htmlSanityCheck.core-2.0.0-SNAPSHOT.module
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.core/2.0.0-SNAPSHOT/org.aim42.htmlSanityCheck.core-2.0.0-SNAPSHOT.jar
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.core/2.0.0-SNAPSHOT/org.aim42.htmlSanityCheck.core-2.0.0-SNAPSHOT.pom
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.core/2.0.0-SNAPSHOT/maven-metadata-local.xml
org/aim42/htmlSanityCheck/htmlSanityCheck-gradle-plugin/maven-metadata-local.xml
org/aim42/htmlSanityCheck/htmlSanityCheck-gradle-plugin/2.0.0-SNAPSHOT/htmlSanityCheck-gradle-plugin-2.0.0-SNAPSHOT.jar
org/aim42/htmlSanityCheck/htmlSanityCheck-gradle-plugin/2.0.0-SNAPSHOT/htmlSanityCheck-gradle-plugin-2.0.0-SNAPSHOT.pom
org/aim42/htmlSanityCheck/htmlSanityCheck-gradle-plugin/2.0.0-SNAPSHOT/htmlSanityCheck-gradle-plugin-2.0.0-SNAPSHOT.module
org/aim42/htmlSanityCheck/htmlSanityCheck-gradle-plugin/2.0.0-SNAPSHOT/maven-metadata-local.xml
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.gradle.plugin/maven-metadata-local.xml
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.gradle.plugin/2.0.0-SNAPSHOT/org.aim42.htmlSanityCheck.gradle.plugin-2.0.0-SNAPSHOT.jar
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.gradle.plugin/2.0.0-SNAPSHOT/org.aim42.htmlSanityCheck.gradle.plugin-2.0.0-SNAPSHOT.pom
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.gradle.plugin/2.0.0-SNAPSHOT/maven-metadata-local.xml
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.gradle.plugin/2.0.0-SNAPSHOT/org.aim42.htmlSanityCheck.gradle.plugin-2.0.0-SNAPSHOT.module
I understand, that for the Gradle plugin the structure where the files are in org.aim42.htmlSanityCheck.gradle.plugin
(beyond org/aim42/htmlSanityCheck
) is necessary. I have a small integration test and it can find and use the plugin then. But the files in htmlSanityCheck-gradle-plugin
have the very same contents. I would guess that I don’t need them. How can I prevent the installer from copying them?
In my wip/refactor-publishing branch I have tried a slightly different approach by dropping/migrating the publisher to the two modules. Nevertheless, I still get the Gradle plugin twice:
org/aim42/htmlSanityCheck/htmlSanityCheck-core/maven-metadata-local.xml
org/aim42/htmlSanityCheck/htmlSanityCheck-core/2.0.0-SNAPSHOT/htmlSanityCheck-core-2.0.0-SNAPSHOT.jar
org/aim42/htmlSanityCheck/htmlSanityCheck-core/2.0.0-SNAPSHOT/htmlSanityCheck-core-2.0.0-SNAPSHOT.pom
org/aim42/htmlSanityCheck/htmlSanityCheck-core/2.0.0-SNAPSHOT/htmlSanityCheck-core-2.0.0-SNAPSHOT.module
org/aim42/htmlSanityCheck/htmlSanityCheck-core/2.0.0-SNAPSHOT/maven-metadata-local.xml
org/aim42/htmlSanityCheck/htmlSanityCheck-gradle-plugin/maven-metadata-local.xml
org/aim42/htmlSanityCheck/htmlSanityCheck-gradle-plugin/2.0.0-SNAPSHOT/htmlSanityCheck-gradle-plugin-2.0.0-SNAPSHOT.jar
org/aim42/htmlSanityCheck/htmlSanityCheck-gradle-plugin/2.0.0-SNAPSHOT/htmlSanityCheck-gradle-plugin-2.0.0-SNAPSHOT.pom
org/aim42/htmlSanityCheck/htmlSanityCheck-gradle-plugin/2.0.0-SNAPSHOT/htmlSanityCheck-gradle-plugin-2.0.0-SNAPSHOT.module
org/aim42/htmlSanityCheck/htmlSanityCheck-gradle-plugin/2.0.0-SNAPSHOT/maven-metadata-local.xml
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.gradle.plugin/maven-metadata-local.xml
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.gradle.plugin/2.0.0-SNAPSHOT/org.aim42.htmlSanityCheck.gradle.plugin-2.0.0-SNAPSHOT.jar
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.gradle.plugin/2.0.0-SNAPSHOT/org.aim42.htmlSanityCheck.gradle.plugin-2.0.0-SNAPSHOT.pom
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.gradle.plugin/2.0.0-SNAPSHOT/maven-metadata-local.xml
org/aim42/htmlSanityCheck/org.aim42.htmlSanityCheck.gradle.plugin/2.0.0-SNAPSHOT/org.aim42.htmlSanityCheck.gradle.plugin-2.0.0-SNAPSHOT.module
I would like to keep this approach as the core module is then published as in Maven which would make consumption of the module more obvious to other users. But I still would like to get rid of the duplicate files in htmlSanityCheck-gradle-plugin
.
Any ideas and feedback are appreciated, thanks in advance.