Module Info is a library providing endpoints for sharing current application build details and the authors' contact information.
The library is intended for use in Spring based applications as the returned data is being gathered from the Spring application properties.
The library shares an additional REST controller:
InfoController
- (GET) /api/info/build-info; Returns:
- name : (String) - A name of the application.
- version : (String) - Version.
- date : (LocalDate) - A date of build.
- os : (String) - The os on which the application has been built.
- (GET) /api/info/build-env-info; Returns:
- jdkDistribution : (String) - A distribution of the JDK used for compilation.
- jdkVersion : (String) - A version of the JDK used for compilation.
- dockerDistribution : (String) - A distribution of docker used for creating the image.
- dockerVersion : (String) - A version of docker used for creating the image.
- (GET) /api/info/contact-info; Returns:
- authors : (List) - A list of authors.
- emailAddresses : (List) - A list of contact email addresses.
- githubLink : (String) - An url to GitHub.
- (GET) /api/info/module-info; Returns:
- BuildInfoDto
- name : (String) - A name of the application.
- version : (String) - Version.
- date : (LocalDate) - A date of build.
- os : (String) - The os on which the application has been built.
- BuildEnvInfoDto
- jdkDistribution : (String) - A distribution of the JDK used for compilation.
- jdkVersion : (String) - A version of the JDK used for compilation.
- dockerDistribution : (String) - A distribution of docker used for creating the image.
- dockerVersion : (String) - A version of docker used for creating the image.
- ContactInfoDto
- authors : (List) - A list of authors.
- emailAddresses : (List) - A list of contact email addresses.
- githubLink : (String) - An url to GitHub.
- BuildInfoDto
To enable the endpoints provided by ModInfo, after adding dependency to your pom.xml file, there is a need of importing configuration to your Spring application context. To do that use the annotation:
@Import( value = { ModuleInfoConfiguration.class } )
in your Spring application or configuration class.
The library uses application properties which need to be defined before usage:
build.name = A name of the application.
build.version = Version.
build.date = A date of build.
build.os = The os on which the application has been built.
build-env.jdk-distribution = A distribution of the JDK used for compilation.
build-env.jdk-version = A version of the JDK used for compilation.
build-env.docker-distribution = A distribution of docker used for creating the image.
build-env.docker-version = A version of docker used for creating the image.
contact.authors = A list of authors.
contact.email-addresses = A list of contact email addresses.
contact.github-link = An url to GitHub.
- JDK 17
- pp-base project installed in the local maven repository (You can check the required version in the pom.xml file in the parent section)
- Created Rest Controller, configuration, service and mapping utility.
- Changed the DTOs records to classes.
- Changed the configuration properties records to classes.
- Restored DTOs as records.