Publishing gradle sub-project artifacts using a commons project

69 Views Asked by At

Consider the following project structure:

app
|_subprojA
|   |_build.gradle
|_subprojB
|   |_build.gradle
|_settings.gradle

settings.gradle

include 'subprojA'
include 'subprojB'

build.gradle (subprojA)

...
dependencies {
...
}

build.gradle (subprojB)

...
dependencies {
  compile project(':subprojA')
}

Run ./gradlew subprojA:uploadArchives and ./gradlew subprojB:uploadArchives

another project, try importing com.abc:subprojB:x.y.z complains that subprojA is not available in any repo.

What I want: in my local i want subprojB to point to the local subprojA for ease in development but while publishing subprojB to artifactory i want it to create a transitive dependency on com.abc:subprojA:x.y.z.

0

There are 0 best solutions below