Can I publish my built jars to a Maven repository?


(Gradle FAQ Bot) #1

Can I publish the jars built by a Gradle build to a maven repository?


(Luke Daley) #2

Yes. You can publish any artifact to a Maven repository. Gradle automatically generates the pom.xml and publishes both to a Maven repository.

The publishing includes all necessary Maven metadata manipulation in the public repository. Gradle also supports installing artifacts to the local Maven cache (including all Maven metadata manipulation). We use the Maven Ant tasks under the hood for this, thus we can guarantee one hundred percent compatibility.

See the chapter on the Maven plugin in the userguide for more information about doing this.