Open Whathecode opened 2 years ago
I have this same issue, would be nice to have an example for multimodule publishing. Like publishing two separate libraries from the same repository.
Got the answer today, you can define it elsewhere in the project and later use it from all places that you need.
Here is a working example with working publishing https://github.com/heershingenmosiken/assertions-android.
gradle.properties contains assertionSdkGroup={yourGroupId}
and then it is used in
build.gradle
as group = assertionSdkGroup
assertions-sdk.gradle
file as groupId assertionSdkGroup
and in
assertions-android-sdk.gradle
as dependencyNode.appendNode('groupId', assertionSdkGroup)
hope this will help you, at least my question is solved.
I just changed my project from a single module to a multiple module project. It is a requirement that the Gradle Plugin is applied on the root project.
But, seemingly things go wrong if
group
andversion
is not specified on the root project. Ifgroup
is not specified on the root project I get the following warning:If
version
is not specified, I get a bad request.Things seem to work if the
version
is set to the same version on the root project than on the sub projects I'm trying to publish. This is also seemingly what is done in the multi-project example project: version is set both in thebuildSrc
plugin, and again in the root project.I can't follow the logic here. Why does
group
andversion
need to be set on the root project? What if I want to version subprojects independently?