RFR: 8333146: Move maven publication logic from build.gradle

Jendrik Johannes duke at openjdk.org
Fri Nov 14 07:04:21 UTC 2025


On Tue, 11 Nov 2025 08:07:32 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

> 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.

Thanks for the ping. I have to rework my PR anyway. There is no need to pay special attention to it. Any change that makes the publishing setup clearer is good IMO. I think this PR is a good step forward.  

(I didn't get back to the topic yet on the my PR, because it is more work as I initially expected. What is complicating things me there is how conceptually get the setup right with the Jars for different platform built on different machines. I have to set aside some mote time for it.)

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

PR Comment: https://git.openjdk.org/jfx/pull/1970#issuecomment-3531205315


More information about the openjfx-dev mailing list