We can check if latest release version of this repository, rusthero/version-checker is 1.2.0
.
public static void main(String[] args) throws IOException, ReleaseOrRepoNotFoundException, RateLimitExceededException {
Version currentVersion = new Version("1.2.0");
GitHubVersionChecker versionChecker = new GitHubVersionChecker("rusthero", "version-checker");
if (!versionChecker.isLatestVersion(currentVersion)) {
System.out.println("README file is outdated!");
}
}
See JavaDoc and tests for learning about other methods and functionality.
To use Version Checker, add my repository and the dependency.
repositories {
mavenCentral()
maven {
url 'https://rusthero.dev'
}
}
dependencies {
implementation 'dev.rusthero:version-checker:1.2.0'
}
<repositories>
<repository>
<id>rusthero</id>
<url>https://rusthero.dev</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>dev.rusthero</groupId>
<artifactId>version-checker</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
You can also install VersionChecker manually by downloading it from releases and adding it to your project.