diff --git a/README.md b/README.md index 477ccf8..402b280 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,29 @@ # Simple Micronaut Application with Gradle and Docker support +## Run using Gradle + +```shell +./gradlew run -t +``` + +## [Semantic versioning](https://zoltanaltfatter.com/2020/04/10/semantic-versioning-with-jgitver/) + +### Plugin [fr.brouillard.oss.gradle.jgitver](https://github.com/jgitver/gradle-jgitver-plugin) + +```shell +./gradlew version +``` + +```shell +./gradlew version | grep Version | awk '{ print $2 }' +``` + +### Update version and add git tag + +```shell +git tag 2024.11.1 +``` + ## Update dependencies ### Plugin [com.github.ben-manes.versions](https://github.com/ben-manes/gradle-versions-plugin) diff --git a/build.gradle b/build.gradle index 4e3b7a8..d552fb0 100644 --- a/build.gradle +++ b/build.gradle @@ -9,6 +9,7 @@ plugins { alias(libs.plugins.nebula.lint) alias(libs.plugins.sonarqube) alias(libs.plugins.jacocolog) + alias(libs.plugins.jgitver) } spotbugs { @@ -24,8 +25,8 @@ tasks.spotbugsMain { sonar { properties { - property 'sonar.projectKey', 'ak-git_Micronaut' - property 'sonar.organization', 'ak-git' + property 'sonar.projectKey', property('sonar.projectKey') + property 'sonar.organization', property('sonar.organization') property 'sonar.host.url', 'https://sonarcloud.io' property 'sonar.branch.name', 'master' property 'sonar.coverage.jacoco.xmlReportPaths', 'build/reports/jacoco/jacocoAggregatedReport/jacocoAggregatedReport.xml' @@ -34,7 +35,6 @@ sonar { allprojects { group = 'com.ak' - version = '2024.09.26' apply plugin: 'idea' apply plugin: 'jacoco' apply plugin: 'org.barfuin.gradle.jacocolog' diff --git a/gradle.properties b/gradle.properties index aec6ed3..f0c3447 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,4 +2,6 @@ org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryEr org.gradle.caching=true org.gradle.parallel=true dependency.analysis.print.build.health=true +sonar.projectKey=ak-git_Micronaut +sonar.organization=ak-git micronautVersion=4.6.2 \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ecdcb79..f021d62 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,6 +5,7 @@ jacocolog = '3.1.0' spotbugs = '6.0.24' ben-manes-versions = '0.51.0' nebula-lint = '20.0.0' +jgitver = '0.10.0-rc03' jspecify = '1.0.0' junit = '5.11.1' @@ -20,6 +21,7 @@ jacocolog = { id = 'org.barfuin.gradle.jacocolog', version.ref = 'jacocolog' } spotbugs = { id = 'com.github.spotbugs', version.ref = 'spotbugs' } ben-manes-versions = { id = 'com.github.ben-manes.versions', version.ref = 'ben-manes-versions' } nebula-lint = { id = 'nebula.lint', version.ref = 'nebula-lint' } +jgitver = { id = 'fr.brouillard.oss.gradle.jgitver', version.ref = 'jgitver' } johnrengelman-shadow = { id = 'com.github.johnrengelman.shadow', version.ref = 'johnrengelman-shadow' } micronaut-application = { id = 'io.micronaut.minimal.application', version.ref = 'io-micronaut' }