Reputation: 2254
I have a multi module android project and currently anyone in our team can access the the modules from our private maven repository.
We are using jFrog Artifactory
hosted in aws
for managing the repositories. The structure of our project is something like this
app
-lib1
-lib2
-lib2a
-lib2b
I want to know if there is a way by which lib2a
and lib2b
is not accessible as separate modules but only accessible when someone adds the dependency of the parent module in their project which is lib2
in this case
Upvotes: 1
Views: 422
Reputation: 364211
I want to know if there is a way by which lib2a and lib2b is not accessible as separate modules but only accessible when someone adds the dependency of the parent module in their project which is lib2 in this case
Short answer:
No, you can't do it.
Long answer:
When you put an artifact in a maven repo you have the artifact files (may be an aar for your android libraries) and a pom file.
The pom file describes also the transitive dependencies of the artifact.
Currently you can't specify a parent dependency or a specific maven repo to be used (this one is under development).
It means that a build system, for example gradle, read the dependency, download from the repos the pom file and download all transitive dependencies.
When you download a transitive dependency there is no way to specify if you have just downloaded the parent or if you are directly downloading it.
It can be available, or not available without conditions.
Upvotes: 1