An open API service indexing awesome lists of open source software.

https://github.com/eitco/spring-config-collector-maven-plugin

a maven plugin collecting all spring configuration properties and generating documentation for them
https://github.com/eitco/spring-config-collector-maven-plugin

Last synced: 10 months ago
JSON representation

a maven plugin collecting all spring configuration properties and generating documentation for them

Awesome Lists containing this project

README

          

[![License](https://img.shields.io/github/license/eitco/spring-config-collector-maven-plugin.svg?style=for-the-badge)](https://opensource.org/license/mit)

[![Build status](https://img.shields.io/github/actions/workflow/status/eitco/spring-config-collector-maven-plugin/deploy.yaml?branch=main&style=for-the-badge&logo=github)](https://github.com/eitco/spring-config-collector-maven-plugin/actions/workflows/deploy.yaml)
[![Maven Central Version](https://img.shields.io/maven-central/v/de.eitco.cicd/spring-config-collector-maven-plugin?style=for-the-badge&logo=apachemaven)](https://central.sonatype.com/artifact/de.eitco.cicd/spring-config-collector-maven-plugin)

# spring config collector maven plugin

This maven plugin collects all spring configuration properties of the project and its dependencies and creates
documentation for them, either in plain html or in asciidoc.

It does so by collection spring boots own configuration meta information files, that can be found inside
jars in `META-INF/spring-configuration-metadata.json`.

> 📘 Note that this only finds configuration properties defined by classes annotated with `@ConfigurationProperties`.
> `@Value` configuration properties will not be found.

# usage

First, add this plugin to your pom:

````xml

de.eitco.cicd
spring-config-collector-maven-plugin
4.0.1

````

Decide whether you want to generate an adoc file or an html file, and add
an execution of the corresponding goal (This example simply executes both goals):

````xml

de.eitco.cicd
spring-config-collector-maven-plugin
4.0.1


adoc

adoc-overview
html-overview


````

This will write the generated files to the target directory. You can specify the directory to write to using the
`outputDirectory` parameter:

````xml

de.eitco.cicd
spring-config-collector-maven-plugin
4.0.1


adoc

adoc-overview
html-overview


${project.build.directory}/config-documentation


````

When building the project this will create an html file and an adoc file containing information about every member of all configuration properties of your application.

This does however include spring standard properties, this might or might not be desired. Should this not be desired
you can filter property names using a regular expression:

````xml

de.eitco.cicd
spring-config-collector-maven-plugin
4.0.1


adoc

adoc-overview
html-overview


${project.build.directory}
my\.property\.prefix\..*|other-prefix.*


````
In this case only properties that begin with `my.property.prefix` or `other-prefix` will be listed in the resulting files.

For better formatting of the generated table the plugin can shorten the class names of the properties, removing the package
and generic types. This can be enabled using the property `true`.

For further examples see the [integration test directory](./src/it).