简体   繁体   中英

Multi module android project inside a private maven repository

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM