ru.mihkopylov:spring-boot-configuration-properties-descriptor-maven-plugin

Plugin to generate documentation for the Spring Boot application configuration

License

License

Categories

Categories

Spring Boot Container Microservices Maven Build Tools Configuration Application Layer Libs config
GroupId

GroupId

ru.mihkopylov
ArtifactId

ArtifactId

spring-boot-configuration-properties-descriptor-maven-plugin
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

ru.mihkopylov:spring-boot-configuration-properties-descriptor-maven-plugin
Plugin to generate documentation for the Spring Boot application configuration
Project URL

Project URL

https://github.com/mih-kopylov/spring-boot-configuration-properties-descriptor-maven-plugin
Source Code Management

Source Code Management

https://github.com/mih-kopylov/spring-boot-configuration-properties-descriptor-maven-plugin/tree/master

Download spring-boot-configuration-properties-descriptor-maven-plugin

How to add to project

<plugin>
    <groupId>ru.mihkopylov</groupId>
    <artifactId>spring-boot-configuration-properties-descriptor-maven-plugin</artifactId>
    <version>1.0.0</version>
</plugin>

Dependencies

compile (9)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.1.1
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4
org.apache.maven : maven-core jar 3.1.1
org.apache.maven : maven-project jar 3.0-alpha-2
org.apache.maven.scm : maven-scm-api jar 1.9.4
org.codehaus.plexus : plexus-interactivity-api jar 1.0-alpha-6
org.twdata.maven : mojo-executor jar 2.3.0
com.fasterxml.jackson.core : jackson-databind jar 2.10.0
org.freemarker : freemarker jar 2.3.29

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.10

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Spring Boot Configuration Descriptor Processor Maven Plugin

Maven Central License

Description

When writing a service which has a lot of configuration, it is very useful to have a single document describing all possible properties of the service.

If the service binds properties to beans using @ConfigurationProperties, such beans with javadocs can be a single source of truth for the service configuration.

The goal of this plugin is to generate markdown description for all the @ConfigurationProperties.

Usage

To have this plugin work, it's required to have spring-boot-configuration-processor dependency that generates metadata /META-INF/spring-configuration-metadata.json which is used as a base for a resulting Markdown document.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-configuration-processor</artifactId>
    <optional>true</optional>
</dependency>

And need to add the plugin to /build/plugins section of pom.xml.

<plugin>
    <groupId>ru.mihkopylov</groupId>
    <artifactId>spring-boot-configuration-properties-descriptor-maven-plugin</artifactId>
    <version>${spring-boot-configuration-properties-descriptor-maven-plugin.version}</version>
    <executions>
        <execution>
            <phase>compile</phase>
            <goals>
                <goal>describe</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Once mvn compile is run, a result CONFIGURATION.md file will be generated. By default it will be placed to root directory beside pom.xml, but this can be configured.

Configuration

This is the default configuration:

<plugin>
    <groupId>ru.mihkopylov</groupId>
    <artifactId>spring-boot-configuration-properties-descriptor-maven-plugin</artifactId>
    <version>${spring-boot-configuration-properties-descriptor-maven-plugin.version}</version>
    <configuration>
        <!--the metadata json file generated by Spring-->
        <jsonFileName>${project.build.outputDirectory}/META-INF/spring-configuration-metadata.json</jsonFileName>
        <!--should the plugin fail if the json metadata file is not found-->
        <failIfNoMetadataFileFound>false</failIfNoMetadataFileFound>
        <!--where to put the result file-->
        <outputFileName>${basedir}/CONFIGURATION.md</outputFileName>
    </configuration>
</plugin>

Versions

Version
1.0.0