Skip to main content

4 posts tagged with "Java"

View All Tags

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.

Java Inner Classes and Static Inner Classes

· 6 min read
Too_Young
Moonlit maintanier

bk

In Java programming, inner classes and static inner classes are two important concepts. They allow defining one class within another, thereby improving code readability and organization. This article will provide a detailed explanation of the concepts, use cases, underlying implementation, and differences between inner classes and static inner classes.

Spring Boot Configuration for Springdoc

· 2 min read
Too_Young
Moonlit maintanier

bk

Recently upgraded SpringBoot to 2.7.5, found that swagger is not working well. After searching online, I found that the problem existed since version 2.6.6. Looking at springfox's GitHub, I saw that someone had raised an issue back in 2020, and it's still not closed. The solutions are quite cumbersome. I plan to replace springfox with springdoc.

caution

This uses swagger3, the annotations are somewhat different from swagger2.