RFR: 8333146: Move maven publication logic from build.gradle
Marius Hanl
mhanl at openjdk.org
Tue Nov 11 08:13:55 UTC 2025
This PR splits the maven publishing logic into an own file, `maven-publish.gradle`, that is next to the root `build.gradle`.
The `build.gradle` will apply the `maven-publish.gradle`. The `maven-publish.gradle` will then configure the Maven related properties and provides `addMavenPublication` as `Closure`.
This way, the logic and code can be completely the same. All modules still call `addMavenPublication`, as before.
https://github.com/openjdk/jfx/blob/013e55b1ba687d212185d00167f375b816faf8c5/build.gradle#L2894-L2898
But the publishing code and properties itself are out of the main `build.gradle`.
Tested with:
- `./gradlew -PMAVEN_PUBLISH=true -PMAVEN_VERSION=custom publishToMavenLocal`
- `./gradlew -PMAVEN_PUBLISH=true publishToMavenLocal`
- `./gradlew -PMAVEN_PUBLISH=true -PMILESTONE_FCS=true publishToMavenLocal`
Everything still works:
-> javafx.base from the local .m2 repository
<img width="1051" height="388" alt="image" src="https://github.com/user-attachments/assets/66ccd007-ff2c-4309-982a-1e8123e9f52a" />
I think this is a good step and an easy way to split out functionality without blowing things up. We might want to do that for other parts as well.
Note: I also fixed the deprecated `buildDir` and 2 warnings where it seems like he might not be able to infer the type (changing `def` to the actual type).
-> The file is completely green, no warnings or deprecations.
-------------
Commit messages:
- 8333146: Move maven publication logic from build.gradle
Changes: https://git.openjdk.org/jfx/pull/1970/files
Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1970&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8333146
Stats: 244 lines in 2 files changed: 130 ins; 114 del; 0 mod
Patch: https://git.openjdk.org/jfx/pull/1970.diff
Fetch: git fetch https://git.openjdk.org/jfx.git pull/1970/head:pull/1970
PR: https://git.openjdk.org/jfx/pull/1970
More information about the openjfx-dev
mailing list