/kotlin-consolidated-plugin

Custom standalone gradle plugin written in Kotlin that consolidates configuration across similar microservices

Primary LanguageKotlinMIT LicenseMIT

Gradle Git Properties

Because all microservices use Spring Actuator, the plugin Gradle Git Properties plugin provides extra information in the actuator info endpoint automatically

Documents

This application uses Spring Auto Restdocs and can be accessed at {host}:{port}/docs ex. localhost:8080/docs.

To see updated documentation the following command must be run (IDE does not generate new documentation):

./gradlew clean build asciidoctor bootRun

Using SonarQube

Code quality is checked using SonarScanner for Gradle like so:

./gradlew clean build sonarqube

To successfully run the sonarqube task, you will need the following properties in ~/.gradle/gradle.properties:

  • systemProp.sonar.host.url

Publishing the JAR to Nexus

Publishing to the Nexus server uses the Maven Publish plugin like so:

./gradlew clean build publish

To successfully publish to the Nexus server, you will need the following properties in ~/.gradle/gradle.properties:

  • nexus.host (This should be the host name of the machine hosting nexus)
  • nexus.port.jar (This should be the port for the maven repositories on the machine hosting nexus)
  • nexus.user (Self-explanatory dummy)
  • nexus.password (Self-explanatory dummy)

Publishing the container to Nexus

Publishing to the Nexus server uses the Jib Gradle plugin like so:

./gradlew clean build jib

To successfully publish to the Nexus server, you will need the following properties in ~/.gradle/gradle.properties:

  • nexus.host (This should be the host name of the machine hosting nexus)
  • nexus.port.image (This should be the port for the docker repositories on the machine hosting nexus)
  • nexus.user (Self-explanatory dummy)
  • nexus.password (Self-explanatory dummy)

Releasing the application

Releasing uses the Gradle Release plugin like so:

./gradlew clean build release

To successfully complete a release, the -SNAPSHOT will need to be removed from all dependencies and you will need the following property in ~/.gradle/gradle.properties:

  • release.git.remote (Ex. origin, upstream, etc.)