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
3
votes
0 answers

How to produce (and consume) multiple AARs from one (Android library) Gradle subproject

Due to use of Unity-as-a-Library we have an Android library module / Gradle subproject that has a number of AAR (Android archive) files in its "libs" directory. We have been using the com.github.kezong:fat-aar Gradle Plugin…
user6519354
  • 169
  • 1
  • 7
3
votes
1 answer

Could not GET '*/maven-metadata.xml'. Received status code 403 from server: Forbidden while publishing to AWS CodeArtifact

I have a maven repo set up in AWS CodeArtifact. I am using maven-publish plugin with Gradle to publish the artifacts. However, gradle exits with the following error - Could not GET 'https://.../maven-metadata.xml'. Received status code 403 from…
shivamag00
  • 661
  • 8
  • 13
3
votes
0 answers

Exclude publish of sources.jar using maven-publish gradle plugin

When using the maven-publish gradle plugin , it publishes both the myapp.jar and myapp-sources.jar files to the maven repo. How can I exclude the publish of the myapp-sources.jar to the maven repo. Following is the publishing section for the…
cooldev
  • 497
  • 1
  • 3
  • 17
3
votes
1 answer

Gradle maven-publish dependency scope

I have a pretty simple Gradle Kotlin project. plugins { id 'application' id 'maven-publish' } repositories { mavenCentral() } dependencies { compile 'com.google.guava:guava:31.1-jre' // 'compile' is deprecated } publishing { …
Marcel
  • 4,054
  • 5
  • 36
  • 50
3
votes
0 answers

Could not create domain object 'gpr' (MavenPublication) in build.gradle.kts

Hey I am trying to publish kmm library in github packages. I followed this doc. But I don't understand what is project.findProperty("gpr.user") and ("gpr.key")? I used macos so System.getenv("USERNAME") and System.getenv("TOKEN") is relevant…
3
votes
2 answers

How to publish to Maven Repo using Gradle 7.0

I am looking for working documentation on how to publish a library to the public Maven repository using Gradle 7.0. I have signed up for an account at Maven (Sonatype Actually), have jumped through the verification hoops, and so that seem to be…
AgilePro
  • 5,588
  • 4
  • 33
  • 56
3
votes
2 answers

Why do we need both javadoc and sources jar?

Generally, when publishing a library, do we need both sources.jar and javadoc.jar? I don't really understand the purpose of javadoc.jar.If it's about the code documentation, the IDE can show it from sources.jar itself. Example: Please note, this is…
theapache64
  • 10,926
  • 9
  • 65
  • 108
3
votes
1 answer

Android: Add maven-publish configuration in a separate kotlin dsl script

I've written a .gradle script named publish.gradle which configures publishing {} for releasing my artifact. Why on a separate script? I have multiple modules and by doing this every releasable module simply defines some variables. Module…
Mahdi-Malv
  • 16,677
  • 10
  • 70
  • 117
3
votes
1 answer

Gradle publishing to Maven adds a suffix that does not seem to work from Maven POM dependencies

When I publish to a local maven repository from a Gradle project, I find that the main JAR file has a -plain suffix. pdffer/pdffer-template/1.0-SNAPSHOT ➜ ll total 32 -rw-r--r-- 1 fedmest staff 918B Sep 1 16:39…
fedmest
  • 709
  • 5
  • 17
3
votes
0 answers

Publishing SNAPSHOT versions of Android libraries using Android Gradle Plugin 7+

I have an Android library (gradle multi module project) where I publish to two different Nexus Maven2 repositories with strict versioning, a release repository and a snapshot repository. This has worked well using Android Gradle Plugin…
Alix
  • 2,630
  • 30
  • 72
3
votes
0 answers

Gradle maven-publish library with dependence on module with multiple publications

I have a library I'm trying to publish that has a dependency on another module in the same project with multiple publications as well. If I configure the gradle build files like this I run into an…
JC Castano
  • 135
  • 1
  • 6
3
votes
0 answers

Could not PUT https://oss.sonatype.org/service/local/staging/deploy/maven2/bom-plugin/

I'm trying to publish my first Gradle plugin to maven central (sonatype), but I'm receiving the following error: Execution failed for task ':publishBom-pluginPluginMarkerMavenPublicationToMavenRepository'. > Failed to publish publication…
3
votes
2 answers

Signing POM file with maven-publish plugin

I try to upload an artifact into Nexus using the maven-publish plugin. Almost all goes well, only one problem I couldn't find solution: the generated POM file is not signed. Here is my code snippet: plugins { maven `maven-publish` …
Balage1551
  • 1,037
  • 1
  • 10
  • 28
3
votes
1 answer

'Received status code 400 from server: Bad Request' While publishing aar file to Github packages

I am trying to push my library to GitHub Packages. I have configured the personal access token and have the github.properties file in the root folder. The aar file is assembled, using gradle assemble. When I am running the gradle publish command.…
3
votes
0 answers

maven-publish plugin gradle only publish specific module

I'm developing a multi-module android project using gradle build. I'm using maven-publish plugin to publish artifact to sonartype nexus. The current setup is inside every module there is a publication job plugins{ …
Lê Khánh Vinh
  • 2,591
  • 5
  • 31
  • 77