Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A lightweight, zero-dependency Java library for parsing, comparing, and managing Semantic Versioning (SemVer 2.0.0) with full spec compliance.

License

Notifications You must be signed in to change notification settings

milkdrinkers/Java-Semver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Java-Semver

GitHub License Maven Central Version Documentation Javadoc GitHub Actions Workflow Status GitHub Issues GitHub last commit Discord Server

Java-Semver is a lightweight, zero-dependency Java library that provides full support for Semantic Versioning 2.0.0. Designed for simplicity and reliability, it enables parsing and comparing semantic versions (major.minor.patch-preRelease+build) effortlessly. Perfect for applications requiring precise version management.


🌟 Features

  • Full SemVer 2.0.0 Compliance: Strict adherence to the official specification.
  • Zero Dependencies: Lightweight and self-contained.
  • Java 8+ compatible: Compatible with legacy and modern Java projects.
  • Simple API: Intuitive methods for parsing and comparing versions.
  • Error Handling: Gracefully handles invalid versions through exceptions.
  • Well-tested: Robust JUnit test coverage ensures reliability.
  • Pre-release & Build Metadata: Supports 1.0.0-alpha+001 and other complex formats.

πŸ“¦ Installation

Add Java-Semver to your project with Maven or Gradle:

Gradle Kotlin DSL
repositories {
    mavenCentral()
}

dependencies {
    implementation("io.github.milkdrinkers:javasemver:LATEST_VERSION")
}
Maven
<project>
    <dependencies>
        <dependency>  
            <groupId>io.github.milkdrinkers</groupId>  
            <artifactId>javasemver</artifactId>  
            <version>LATEST_VERSION</version>  
        </dependency>  
    </dependencies>
</project>

Usage Example πŸš€

import io.github.milkdrinkers.javasemver.Version;

final Version currentVersion = Version.of("1.0.0-RC.1+5");
final Version latestVersion = Version.of("2.0.0-beta+exp.sha.5114f85");

Version.isNewer(currentVersion, latestVersion); // false
Version.isNewerOrEqual(currentVersion, latestVersion); // false
Version.isEqual(currentVersion, latestVersion); // false
Version.isOlderOrEqual(currentVersion, latestVersion); // true
Version.isOlder(currentVersion, latestVersion); // true

πŸ“š Documentation


πŸ”¨ Building from Source

git clone https://github.com/milkdrinkers/Java-Semver.git
cd javasemver
./gradlew publishToMavenLocal

πŸ”§ Contributing

Contributions are always welcome! Please make sure to read our Contributor's Guide for standards and our Contributor License Agreement (CLA) before submitting any pull requests.

We also ask that you adhere to our Contributor Code of Conduct to ensure this community remains a place where all feel welcome to participate.


πŸ“ Licensing

You can find the license the source code and all assets are under here. Additionally, contributors agree to the Contributor License Agreement (CLA) found here.


πŸ”₯ Consuming Projects

Here is a list of known projects using Java-Semver:

  • Minecraft-Plugin-Template - Provided by default in a Minecraft Plugin Template.
  • VersionWatch - A lightweight library that simplifies version monitoring across popular software distribution platforms..
  • Maquillage - Maquillage a Minecraft cosmetics plugin.
  • Stewards - Stewards a Minecraft Towny NPC extension plugin.
  • CharacterCards - CharacterCards is a Minecraft plugin allowing players to create cards describing their character.
  • (Add your project here!)

About

A lightweight, zero-dependency Java library for parsing, comparing, and managing Semantic Versioning (SemVer 2.0.0) with full spec compliance.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

Contributors 2

  •  
  •  

Languages