I have 2 questions.
- Root Project override the subproject dependencies
In the subProject “sub” build.gradle, there is a dependency ’
compile group: “com.abc”, name: “test”,version: “2.1.+” } ’
In the rootProject build.gradle, i want to set the subproject with this dependency
compile group: “com.abc”, name:“test”,version:“2.2.0-SNAPSHOT”
Since I want to have different dependencies when running at different directory. If running from root project, i want to use the snapshot one. If running from the subproject directory, i want to use the latest release version.
Apart from the version, sometimes I may need to completely override the subproject one or edit the dependencies in the subproject from the rootProject perspective?
Is there any ways to do so?
In fact, which dependencies will load first?
If they are no overlap packages, they will combine each others?
If there are repeated packages, what will be the final result?
- Another question about the local repo
Since I have several subprojects locally, so i want to directly use them instead of publishing the project and downloading the packages from the maven sever/local repo. Is there any ways to perform my action without any publish?
I have tried to change it from
compile group: “com.abc”, name:“root”,version:“2.2.0-SNAPSHOT” }’
compile project(“root”) }’
But there is no publish in that project and no jar…fail to compile…
How to solve it?