RFR: 8333146: Move maven publication logic from build.gradle [v3]

Marius Hanl mhanl at openjdk.org
Sun Nov 16 11:03:44 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.

Marius Hanl has updated the pull request incrementally with three additional commits since the last revision:

 - Use projects directly
 - Further reduce coupling between main build.gradle and maven-publish.gradle
 - Move MAVEN_GROUP_ID and fail() over to maven-publish.gradle

-------------

Changes:
  - all: https://git.openjdk.org/jfx/pull/1970/files
  - new: https://git.openjdk.org/jfx/pull/1970/files/2b45aa63..b465f5e0

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jfx&pr=1970&range=02
 - incr: https://webrevs.openjdk.org/?repo=jfx&pr=1970&range=01-02

  Stats: 208 lines in 3 files changed: 124 ins; 78 del; 6 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