I’m very new to Gradle. As my first task, I’m creating build.gradle scripts for some Maven libraries I use.
I’ve tried both the Java plugin’s uploadArchive and the maven-publish plugin to put the *.jar and *.pom files into my local repository (I prefer uploadArchive). The files are usable by other Gradle scripts and Maven pom.xml files. The latter is important as these libraries will later be used by licensees outside my company.
When I create my JAR files with Maven, the org.apache.maven.plugins.maven-jar-plugin adds to a JAR’s META-INF a directory ‘META-INF/maven/$project.group/$project.name’ that contains my pom.xml and generated pom.properties file. Gradle’s Java jar does not do this.
Question: How can I create this directory tree in my Gradle-produced JAR, generate the pom.properties file and add it, and add the Gradle-generated pom? This isn’t strictly necessary, I know, but doing so would simplify my work when in comes to distributing my JAR files.