{"id":27876905,"url":"https://github.com/ethauvin/semver","last_synced_at":"2026-03-10T10:06:36.536Z","repository":{"id":57737842,"uuid":"50268758","full_name":"ethauvin/semver","owner":"ethauvin","description":" Semantic Version Annotation Processor","archived":false,"fork":false,"pushed_at":"2026-03-02T06:00:27.000Z","size":1596,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-02T10:45:54.732Z","etag":null,"topics":["annotation-processing","annotation-processor","annotations","auto-increment","gradle","java","kobalt","mustache","semantic","semver","version","versioning"],"latest_commit_sha":null,"homepage":"https://erik.thauvin.net/blog/posts/6373/semantic-version-annotation-processor-10","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethauvin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-01-24T02:26:26.000Z","updated_at":"2026-03-02T06:00:32.000Z","dependencies_parsed_at":"2026-03-02T08:07:37.913Z","dependency_job_id":null,"html_url":"https://github.com/ethauvin/semver","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ethauvin/semver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fsemver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fsemver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fsemver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fsemver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethauvin","download_url":"https://codeload.github.com/ethauvin/semver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fsemver/sbom","scorecard":{"id":383877,"data":{"date":"2025-08-11","repo":{"name":"github.com/ethauvin/semver","commit":"7d364e41ca56ff124e7528e6df29f6803294f807"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/bld.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":9,"reason":"11 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":0,"reason":"binaries present in source code","details":["Warn: binary detected: bin/main/net/thauvin/erik/semver/Constants.class:1","Warn: binary detected: bin/main/net/thauvin/erik/semver/Version.class:1","Warn: binary detected: bin/main/net/thauvin/erik/semver/VersionInfo.class:1","Warn: binary detected: bin/main/net/thauvin/erik/semver/VersionProcessor.class:1","Warn: binary detected: bin/test/net/thauvin/erik/semver/ConstantsTest.class:1","Warn: binary detected: bin/test/net/thauvin/erik/semver/VersionInfoTest.class:1","Warn: binary detected: bin/test/net/thauvin/erik/semver/VersionProcessorTest.class:1","Warn: binary detected: bin/test/net/thauvin/erik/semver/VersionTest.class:1","Warn: binary detected: examples/java/bld/lib/bld/bld-wrapper.jar:1","Warn: binary detected: examples/java/gradle/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: examples/kotlin/gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: lib/bld/bld-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/bld.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/ethauvin/semver/bld.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/bld.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/ethauvin/semver/bld.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/bld.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/ethauvin/semver/bld.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/bld.yml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/ethauvin/semver/bld.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T16:07:48.396Z","repository_id":57737842,"created_at":"2025-08-18T16:07:48.397Z","updated_at":"2025-08-18T16:07:48.397Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30329698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["annotation-processing","annotation-processor","annotations","auto-increment","gradle","java","kobalt","mustache","semantic","semver","version","versioning"],"created_at":"2025-05-05T02:53:45.609Z","updated_at":"2026-03-10T10:06:36.506Z","avatar_url":"https://github.com/ethauvin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semantic Version Annotation Processor\n\n[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause)\n[![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)\n[![bld](https://img.shields.io/badge/2.2.1-FA9052?label=bld\u0026labelColor=2392FF)](https://rife2.com/bld)\n[![release](https://img.shields.io/github/release/ethauvin/semver.svg)](https://github.com/ethauvin/semver/releases/latest)\n[![Nexus Snapshot](https://img.shields.io/nexus/s/net.thauvin.erik/semver?label=snapshot\u0026server=https%3A%2F%2Foss.sonatype.org%2F)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/semver/)\n[![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/semver.svg)](https://central.sonatype.com/artifact/net.thauvin.erik/semver)\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_semver\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=ethauvin_semver)\n[![GitHub CI](https://github.com/ethauvin/semver/actions/workflows/bld.yml/badge.svg)](https://github.com/ethauvin/semver/actions/workflows/bld.yml)\n[![Build status](https://ci.appveyor.com/api/projects/status/nbv4mxd1gpxtx69o?svg=true)](https://ci.appveyor.com/project/ethauvin/semver)\n[![CircleCI](https://circleci.com/gh/ethauvin/semver/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/semver/tree/master)\n\nAn [annotation processor](https://docs.oracle.com/javase/8/docs/api/javax/annotation/processing/Processor.html) that automatically generates a `GeneratedVersion` class based on a [Mustache](https://mustache.github.io/) template and containing the [semantic version](https://semver.org/) (major, minor, patch, etc.) that is read from a [Properties](https://docs.oracle.com/javase/tutorial/essential/environment/properties.html) file or defined in the [annotation](https://docs.oracle.com/javase/tutorial/java/annotations/basics.html).\n\nThis processor was inspired by Cédric Beust's [version-processor](https://github.com/cbeust/version-processor) and works well in conjunction with the [__Semantic Version Plugin for Gradle__](https://github.com/ethauvin/semver-gradle).\n\n## Table of Contents\n\n- [Semantic Version Annotation Processor](#semantic-version-annotation-processor)\n  - [Table of Contents](#table-of-contents)\n  - [Examples](#examples)\n  - [Template](#template)\n    - [Default Template](#default-template)\n    - [Custom Template](#custom-template)\n  - [Elements \\\u0026 Properties](#elements--properties)\n  - [Maven](#maven)\n  - [bld](#bld)\n  - [Gradle](#gradle)\n    - [Class Generation](#class-generation)\n    - [Class \\\u0026 Source Generation](#class--source-generation)\n  - [Kotlin](#kotlin)\n    - [Kotlin \\\u0026 Gradle](#kotlin--gradle)\n  - [Auto-Increment](#auto-increment)\n  - [Contributing](#contributing)\n\n## Examples\n\n- Using annotation elements:\n\n```java\nimport net.thauvin.erik.semver.Version;\n\n@Version(major = 2, minor = 1, patch = 1, preRelease = \"beta\")\npublic class A {\n    // ...\n}\n```\n\n- Or using a [properties](hhttps://github.com/ethauvin/semver/blob/master/examples/java/version.properties) file:\n\n```java\nimport net.thauvin.erik.semver.Version;\n\n@Version(properties = \"version.properties\")\npublic class A {\n    // ...\n}\n```\n\n```ini\n# version.properties\nversion.major=1\nversion.minor=0\nversion.patch=0\nversion.prerelease=beta\n```\n\n[View Examples](https://github.com/ethauvin/semver/tree/master/examples)\n\n## Template\n\nUpon running the annotation processor, a source file [GeneratedVersion.java](https://github.com/ethauvin/semver/blob/master/examples/java/src/generated/java/com/example/GeneratedVersion.java) is automatically generated with static methods to access the semantic version data. The source is based on a fully customizable Mustache [template](https://github.com/ethauvin/semver/blob/master/src/main/resources/semver.mustache).\n\nTo use your own template, simply create a `version.mustache` file in the project's root directory. The processor will automatically look for it.\n\nTo specify your own template name, use:\n\n```java\n@Version(template = \"version.mustache\")\npublic class A {\n    // ...\n}\n```\n\n### Default Template\n\nThe [default template](https://github.com/ethauvin/semver/blob/master/src/main/resources/semver.mustache) implements the following static variables:\n\n| Field              | Description                      | Example                                                                           |\n|:-------------------|:---------------------------------|:----------------------------------------------------------------------------------|\n| `PROJECT`          | The project name, if any.        | `MyProject`                                                                       |\n| `BUILDDATE`        | The build date.                  | [`java.util.Date`](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html) |\n| `VERSION`          | The full version string.         | `1.2.3-alpha+001`                                                                 |\n| `MAJOR`            | The major version.               | `1`                                                                               |\n| `MINOR`            | The minor version.               | `2`                                                                               |\n| `PATCH`            | The patch version.               | `3`                                                                               |\n| `PRERELEASE`       | The pre-release version, if any. | `alpha`                                                                           |\n| `PRERELASE_PREFIX` | The pre-release prefix           | `-`                                                                               |\n| `BUILDMETA`        | The build metadata, if any.      | `001`                                                                             |\n| `BUILDMETA_PREFIX` | The metadata prefix.             | `+`                                                                               |\n| `SEPARATOR`        | The version separator.           | `.`                                                                               |\n\n### Custom Template\n\nA very simple custom template might look something like:\n\n```java\n/* version.mustache */\npackage {{packageName}};\n\nimport java.util.Date;\n\npublic final class {{className}} {\n    public final static String PROJECT = \"{{project}}\";\n    public final static Date DATE = new Date({{epoch}}L);\n    public final static String VERSION = \"{{semver}}\";\n}\n```\n\nThe mustache variables automatically filled in by the processor are:\n\n| Variable                      | Description                 | Type     |\n|:------------------------------|:----------------------------|:---------|\n| `{{packageName}}`             | The package name.           | `String` |\n| `{{className}}`               | The class name.             | `String` |\n| `{{project}}`                 | The project name.           | `String` |\n| `{{epoch}}`                   | The build epoch/unix time.  | `long`   |\n| `{{major}}`                   | The major version.          | `int`    |\n| `{{minor}}`                   | The minor version.          | `int`    |\n| `{{patch}}`                   | The patch version.          | `int`    |\n| `{{preRelease}}`              | The pre-release version.    | `String` |\n| `{{preReleasePrefix}}`        | The pre-release prefix.     | `String` |\n| `{{buildMeta}}`               | The build metadata version. | `String` |\n| `{{buildMetaPrefix}}`         | The metadata prefix.        | `String` |\n| `{{separator}}`               | The version separator.      | `String` |\n| `{{semver}}` or `{{version}}` | The full semantic version.  | `String` |\n\n## Elements \u0026 Properties\n\nThe following annotation elements and properties are available:\n\n| Element            | Property                    | Description                       | Default                   |\n|:-------------------|:----------------------------|:----------------------------------|:--------------------------|\n| `project`          | `version.project`           | The project name.                 |                           |\n| `major`            | `version.major`             | The major version number.         | `1`                       |\n| `minor`            | `version.major`             | The minor version number.         | `0`                       |\n| `patch`            | `version.patch`             | The patch version number.         | `0`                       |\n| `preRelease`       | `version.prerelease`        | The pre-release version.          |                           |\n| `preReleasePrefix` | `version.prerelease.prefix` | The pre-release prefix.           | `-`                       |\n| `buildMeta`        | `version.buildmeta`         | The build metadata version.       |                           |\n| `buildMetaPrefix`  | `version.buildmeta.prefix`  | The metadata prefix.              | `+`                       |\n| `separator`        | `version.separator`         | The version separator.            | `.`                       |\n| `packageName`      |                             | The package name.                 | _Same as annotated class_ |\n| `className`        |                             | The name of the generated class.  | `GeneratedVersion`        |\n| `properties`       |                             | The properties file.              |                           |\n| `template`         |                             | The template file.                | `version.mustache`        |\n| `type`             |                             | Either `java` or `kt` for Kotlin. | `java`                    |\n| `keysPrefix`       |                             | The prefix for all property keys. | `version.`                |\n\nIn order to easily incorporate with existing projects, the property keys may be assigned custom values:\n\n```java\n@Version(\n  properties = \"example.properties\",\n  keysPrefix = \"example.\",\n  majorKey = \"maj\",\n  minorKey = \"min\",\n  patchKey = \"build\",\n  preReleaseKey = \"rel\",\n  buildMetaKey = \"meta\",\n  projectKey = \"project\"\n)\npublic class Example {\n    // ...\n}\n```\n\n```ini\n# example.properties\nexample.project=Example\nexample.maj=1\nexample.min=0\nexample.build=0\nexample.rel=beta\nexample.meta=\n# ...\n```\n\n\u003e :warning: `keysPrefix` is a new element staring in `1.1.0` and may break older versions when using custom property keys.\\\n\u003e :zap: A quick fix is to include `keysPrefix=\"\"` in the annotation to remove the default `version.` prefix.\n\n## Maven\n\nTo install and run from [Maven](https://maven.apache.org/), configure an artifact as follows:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003enet.thauvin.erik\u003c/groupId\u003e\n    \u003cartifactId\u003esemver\u003c/artifactId\u003e\n    \u003cversion\u003e1.2.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n```console\nmvn verify\n```\n\nPlease look at [pom.xml](https://github.com/ethauvin/semver/blob/master/examples/java/gradle/pom.xml) in the [examples/java/gradle](https://github.com/ethauvin/semver/tree/master/examples/java/gradle) directory for a sample:\n\n\n## bld\n\nTo install and run from [bld](https://rife2.com/bld), just add the dependency to your build file:\n\n```java\npublic class ExampleBuild extends Project {\n    public ExampleBuild() {\n        // ...\n        scope(compile)\n            .include(dependency(\"net.thauvin.erik\", \"semver\", version(1, 2, 1)));\n    }\n}\n```\n\nPlease look at [ExampleBuild](https://github.com/ethauvin/semver/blob/master/examples/java/bld/src/bld/java/com/example/ExampleBuild.java) in the [examples/java/bld](https://github.com/ethauvin/semver/tree/master/examples/java/bld) directory for a sample. It also shows how to incorporate the generated code into the `source tree`, more information is also available [here](https://forum.uwyn.com/post/36).\n\nbld also has a [Generated Version](https://github.com/rife2/bld-generated-version) extension which provides similar functionalities.\n\n## Gradle\n\n### Class Generation\n\nTo install and run from [Gradle](https://gradle.org/), add the following to [build.gradle](https://github.com/ethauvin/semver/blob/master/examples/java/gradle/build.gradle):\n\n```gradle\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    annotationProcessor 'net.thauvin.erik:semver:1.2.1'\n    compileOnly 'net.thauvin.erik:semver:1.2.1'\n}\n\ntasks.withType(JavaCompile).configureEach {\n    options.compilerArgs += [ \"-Asemver.project.dir=$projectDir\" ]\n}\n```\n\nThe directory containing the configuration files (`version.properties`, `version.mustache`) must be specified using the `semver.project.dir` processor argument.\n\nThe [`GeneratedVersion.java`](https://github.com/ethauvin/semver/blob/master/examples/java/src/generated/java/com/example/GeneratedVersion.java) class will be automatically created in the `build/generated` directory upon compiling.\n\nPlease look at [build.gradle](https://github.com/ethauvin/semver/blob/master/examples/java/gradle/build.gradle) in the [examples/java/gradle](https://github.com/ethauvin/semver/tree/master/examples/java/gradle) directory for a sample.\n\n### Class \u0026 Source Generation\n\nIn order to also incorporate the generated source code into the `source tree`, add the following to [build.gradle](https://github.com/ethauvin/semver/blob/master/examples/java/build.gradle):\n\n```gradle\ntasks.withType(JavaCompile).configureEach {\n    options.generatedSourceOutputDirectory.set(file(\"${projectDir}/src/generated/java\"))\n}\n```\n\nThe [`GeneratedVersion.java`](https://github.com/ethauvin/semver/blob/master/examples/java/src/generated/java/com/example/GeneratedVersion.java) file will now be located in `src/generated`.\n\n## Kotlin\n\nThe annotation processor also supports [Kotlin](https://kotlinlang.org/).\n\nTo generate a Kotlin version file, simply specify the `type` as follows:\n\n```kotlin\nimport net.thauvin.erik.semver.Version\n\n@Version(properties = \"version.properties\", type=\"kt\")\nopen class Main {\n    // ...\n}\n```\n\nThe [Kotlin default template](https://github.com/ethauvin/semver/blob/master/src/main/resources/semver-kt.mustache) implements the same static fields and functions as the [Java template](#default-template).\n\nPlease look at the [examples/kotlin](https://github.com/ethauvin/semver/tree/master/examples/kotlin) project for a [build.gradle.kts](https://github.com/ethauvin/semver/blob/master/examples/kotlin/build.gradle.kts) sample.\n\n### Kotlin \u0026 Gradle\n\nTo install and run from [Gradle](https://gradle.org/), add the following to [build.gradle.kts](https://github.com/ethauvin/semver/blob/master/examples/kotlin/build.gradle.kts):\n\n```kotlin\nvar semverProcessor = \"net.thauvin.erik:semver:1.2.1\"\n\ndependencies {\n    kapt(semverProcessor)\n    compileOnly(semverProcessor)\n}\n\nkapt {\n    arguments {\n        arg(\"semver.project.dir\", projectDir.absolutePath)\n    }\n}\n```\n\nThe directory containing the configuration files (`version.properties`, `version.mustache`) must be specified using the `semver.project.dir` processor argument.\n\n## Auto-Increment\n\nIncrementing the version is best left to your favorite build system. For a solution using Gradle, please have a look at the [__Semver Version Plugin for Gradle__](https://github.com/ethauvin/semver-gradle).\n\nThere are also full [examples](https://github.com/ethauvin/semver-gradle/tree/master/examples/annotation-processor) in both [Java](https://github.com/ethauvin/semver-gradle/tree/master/examples/annotation-processor/java) and [Kotlin](https://github.com/ethauvin/semver-gradle/tree/master/examples/annotation-processor/kotlin) showing how to use both the plugin and annotation processor concurrently.\n\n## Contributing\n\nIf you want to contribute to this project, all you have to do is clone the GitHub\nrepository:\n\n```console\ngit clone git@github.com:ethauvin/semver.git\n```\n\nThen use [bld](https://rife2.com/bld) to build:\n\n```console\ncd semver\n./bld compile\n```\n\nThe project has an [IntelliJ IDEA](https://www.jetbrains.com/idea/) project structure. You can just open it after all\nthe dependencies were downloaded and peruse the code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethauvin%2Fsemver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethauvin%2Fsemver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethauvin%2Fsemver/lists"}