I have added the upload task to my init.gradle
uploadArchives {
repositories {
mavenDeployer { repository(url: "file:D:\gradle-repo") }
}
I have a root project with a settings.gradle and two sub projects
rootproject
settings.gradle ( this includes project1 and project2 )
project1
build.gradle
project2
build.gradle
When I try to build and upload project1 and project2 individually it works. But when i try to run the gradle upload from rootProject ,I get the below error
Could not publish configuration ‘archives’
For artifact {:rootproject:unspecified:jar}: The groupId cannot be empty.
What I observed was that the gradle was trying to publish the root project also and it could not get the version and group Id.
When i move the uploadArchives task out of the init.gradle and add it within subprojects of the settings.gradle , then it works fine.
Is there some setting to be done to exclude root project from getting uploaded ?