Skip to content

Lightweight Java library to fetch the latest software versions from Spigot, Modrinth, GitHub, and more, with SemVer parsing and sync/async support.

License

Notifications You must be signed in to change notification settings

milkdrinkers/VersionWatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

70 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

VersionWatch

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

VersionWatch is a lightweight, easy-to-use Java library that simplifies version monitoring across popular software distribution platforms.

It supports both synchronous and asynchronous requests and leverages Semantic Versioning (SemVer) for parsing and comparing versions via the Java-Semver library.


🌟 Features

  • Java 8+ compatible: Works with older and modern Java environments.
  • Sync/Async support: Choose between blocking or non-blocking requests.
  • Well-tested: Robust JUnit test coverage ensures reliability.
  • Simple API: Minimal setup and intuitive methods.
  • SemVer Support: Built on Java-Semver for reliable parsing and comparison of semantic versions.
  • Light: The library is built with bundle size in mind to keep your application small.
  • Wide Support: Supports fetching versions from Spigot, Modrinth, CurseForge, GitHub, Hangar, BuiltByBit and Polymart.

πŸ“¦ Installation

Add VersionWatch and its Java-Semver dependency to your project with Maven or Gradle:

Gradle Kotlin DSL
repositories {
    mavenCentral()
}

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

Usage Example πŸš€

import io.github.milkdrinkers.javasemver.Version;
import io.github.milkdrinkers.versionwatch.Platform;
import io.github.milkdrinkers.versionwatch.VersionWatcher;

final Version currentVersion = Version.of("1.0.0");

// Build a version watcher for spigot
final VersionWatcher watcher = VersionWatcher.builder()
    .withPlatform(Platform.Spigot)
    .withVersion(currentVersion)
    .withResourceId("1234567")
    .withAgent("VersionWatch")
    .build();

// Fetch the latest version with a blocking request
final Version latestVersion = watcher.fetchLatest(); // The result is cached in the watcher

System.out.println("Has update: " + !watcher.isLatest().toString())  

πŸ“š Documentation


πŸ”¨ Building from Source

git clone https://github.com/milkdrinkers/VersionWatch.git
cd versionwatch
./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 VersionWatch:

  • Minecraft-Plugin-Template - Provided by default in a Minecraft Plugin Template.
  • RaidsPerRegion - RaidsPerRegion a Minecraft PvE raids plugin.
  • 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!)

Sponsor this project

Contributors 2

  •  
  •  

Languages