Skip to main content

3 posts tagged with "Gradle"

Gradle build Tool

View All Tags

Maven Central Publish Guide(for Gradle)

· 4 min read
Too_Young
Moonlit maintanier

bk

When we develop common utility classes or libraries in a project, we often want others to be able to reference and reuse these results directly.
At this point, there are two main options:

  • Private Publishing: Publish the dependency to a private Maven repository within your team or organization for internal sharing;
  • Public Publishing: Publish the dependency to a public repository on the Internet, such as Maven Central, so that developers worldwide can use your open-source library.

This article provides a detailed guide on how to publish your Gradle project to Maven Central.

Developing a Gradle plugin

· 8 min read
Too_Young
Moonlit maintanier

bk

I've recently been learning how to write a Gradle plugin and want to document my insights.

Types of Plugins

There are three ways to implement a Gradle plugin: Script plugins, Precompiled script plugins, and Binary plugins.

  • Script plugins: The plugin logic is implemented directly in the build.gradle file and can only be used in the current build.
  • Precompiled script plugins: The plugin logic is implemented in a separate file (either .gradle or .gradle.kts) within the project and can be used across multiple builds in the project.
  • Binary plugins: The plugin logic is implemented in a standalone project and packaged as a JAR file, which can be referenced and used in other projects by including the JAR file.

In this article, we'll create a Binary plugin using a separate project.