kske
kske

Reputation: 138

How to abstract common build logic from unrelated Gradle builds?

I am currently migrating several Maven projects to Gradle. Some of them are simple, some are multi-module builds, but all are stored in separate Git repositories. All projects rely on a common "Master POM" which defines the following sections:

For example, all projects use the same Maven repository (Nexus).

How can I introduce this kind of common configuration to Gradle, ideally stored in a separate Git repository?

Upvotes: 2

Views: 364

Answers (1)

Dave562
Dave562

Reputation: 281

you can check out this sample. Generally sharing build logic in Gradle is achieved through plugins mechanism.

This documentation describes how to create plugins, which can then be published to maven repository and applied in different projects.

For sharing dependency versions there is version catalogs or platforms

Upvotes: 4

Related Questions