Questions tagged [maven-publish]

A Gradle plugin for publishing build artifacts to an Apache Maven Repository.

https://docs.gradle.org/current/userguide/publishing_maven.html

219 questions
116
votes
9 answers

How do you set the maven artifact ID of a Gradle project?

From the gradle maven-publish plugin's documentation, it's clear that you set the groupId and version of the project directly in build.gradle: group = 'org.gradle.sample' version = '1.0' However, the artifactId appears to be taken from the name of…
Armand
  • 23,463
  • 20
  • 90
  • 119
104
votes
7 answers

Publish an Android library to Maven with AAR and sources JAR

Can somebody give me a hint on how to use the maven-publish Gradle plugin to publish a com.android.library project/module with AAR and source jar? I am able to do this with the old maven plugin - but I would like to use the new maven-publish plugin.
ligi
  • 39,001
  • 44
  • 144
  • 244
94
votes
5 answers

Upload artifact to Artifactory using Gradle

I am a newbie to Gradle and Artifactory and I want to upload a JAR file to Artifactory. Here is my build.gradle file: apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'maven' apply plugin: 'artifactory-publish' groupId = 'myGroup' version…
tuncaysenturk
  • 1,067
  • 1
  • 8
  • 7
91
votes
5 answers

Publish Java artifact to Maven Local with Gradle

I am facing a problem when trying to install a generated jar into my local Maven Repository. The message error just show me 'task 'publish' is not found' I am using this Gradle Script: buildscript { ext { springBootVersion =…
Erikson Murrugarra
  • 1,379
  • 3
  • 13
  • 22
27
votes
8 answers

Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0

With Gradle 7.2 and these plugins: plugins { id 'com.android.library' // Android Gradle Plugin 7.1.2 id 'maven-publish' } It still works, but gives me this deprecation warning: WARNING: Software Components will not be created automatically…
22
votes
9 answers

Could not get unknown property 'release' for SoftwareComponentInternal - Maven publish plugin project gradle

I have an Android project with multiple modules and I want to publish them to self-hosted maven repo. I earlier had the publishing code present in individual modules and things worked just fine. I am now trying to move the publishing code into the…
Swapnil
  • 1,870
  • 2
  • 23
  • 48
17
votes
5 answers

Android / Execution failed for task checkDebugAarMetadata / A failure occurred while executing CheckAarMetadataWorkAction

TL'DR: In this Android Kotlin library I updated from Gradle 5.6.4 to 6.6.1 (commit d5d8d2). Now I cannot build a project depending on the aar anymore. Test setup I build and deploy the aar to mavenLocal ... $ ./gradlew clean :roadsigns:assemble $…
JJD
  • 50,076
  • 60
  • 203
  • 339
17
votes
6 answers

BootJar + MavenJar. Artifact wasn't produced by this build

I have a sample project with the following hierearhy: Sample (root) -- model (simple jar) -- api (springboot jar) I want to publish both generated jars: plain jar & bootJar to my localRepository. gradlew clean build -xTest…
Ermintar
  • 1,322
  • 3
  • 22
  • 39
16
votes
3 answers

Publishing is not able to resolve a dependency on a project with multiple publications that have different coordinates

I have 2 lib modules : library , library2, and use android-maven-publish to publish my multi-modules android project with multi-productFlavors build.gradle in library: apply plugin: 'com.android.library' apply plugin:…
kkooff114
  • 185
  • 1
  • 9
15
votes
1 answer

Publishing of a modular library to Maven using Gradle

Suppose I'm using Gradle for a modular library development. In my root project I have subprojects geometry, algorithms, visualizer, and I'd like to publish a jar artifact of each. As for now in my root build.gradle I have the following part: apply…
hotkey
  • 140,743
  • 39
  • 371
  • 326
14
votes
2 answers

Gradle signArchives unable to read Secret Key

I am trying to publish my Java Library to Maven Central. A part of this involves using the signing gradle plugin to sign the artifacts. I need to sign it without using the keyring file as document here as I cant provide my CI secure access to the…
Eduardo
  • 6,900
  • 17
  • 77
  • 121
14
votes
1 answer

Why is 'publishing' function not being found in my custom gradle.kts file within buildSrc directory?

I have a custom gradle.kts script I am building that will do our maven publishing for all of our various modules to our sonatype repository, but encountering a strange error. Here are the contents of my maven-deploy.gradle.kts file: plugins { …
Shan
  • 541
  • 3
  • 11
13
votes
3 answers

Gradle, SpringBoot, MavenPublish - Publication only contains dependencies and/or constraints without a version

I'm using maven-publish plugin in Gradle to publish my Spring Boot application jar. I run the usual task: ./gradlew artifactorypublish. However, the following error appeared, which I could understand the meaning of: > Task :assembleArtifact > Task…
Nakamura
  • 942
  • 2
  • 12
  • 23
13
votes
1 answer

How to publish artifacts on different maven repositories with Gradle?

I'm using Gradle to publish to a local Artifactory repository. I generate 3 jars during the build: one classic jar with .class, one with javadoc (-javadoc.jar) and one with sources (-sources). I wand to publish my binary jar and the javadoc jar to a…
Thibaut D.
  • 2,521
  • 5
  • 22
  • 33
11
votes
3 answers

Gradle Artifactory Plugin - How to publish artifacts from multiple modules in a project?

I have a project which has a SharedCode (Java) module and secondly an Android (Android library) module which depends on the SharedCode module. I want to publish a jar artifact from the SharedCode module and an aar artifact from the Android module. I…
Adil Hussain
  • 30,049
  • 21
  • 112
  • 147
1
2 3
14 15