I have a multi-module Gradle project:
RootProject
|_ ProjectA
|_ SubModuleA.1
|_ SubModuleA.2
|_ gradle.properties
|_ build.gradle
|_ ProjectB
|_ gradle.properties
|_ build.gradle
|_ gradle.properties
|_ build.gradle
|_ settings.gradle
I have a different version specified in the gradle.properties
files of (1) the root project, (2) Project A, (3) Project B.
For example, in root project#gradle.properties
:
version=0.0.0
And in Project A#gradle.properties
:
version=0.0.0.1
However, when I try to ./gradlew clean publish
on Project A, my submoduleA.1’s jar has the version 0.0.0
when I expect it to be 0.0.0.1
. What is wrong here? Shouldn’t the gradle.properties
file be overridden further down the file structure hierarchy (i.e. using Project A’s properties instead of the root properties)?
P.S. I am using the maven-publish plugin as well, if that affects anything.