An open API service indexing awesome lists of open source software.

https://github.com/samcarlberg/update-checker


https://github.com/samcarlberg/update-checker

Last synced: over 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# update-checker

[ ![Download](https://api.bintray.com/packages/samcarlberg/maven-artifacts/update-checker/images/download.svg) ](https://bintray.com/samcarlberg/maven-artifacts/update-checker/_latestVersion)

A simple Java library that checks for updates to software in Maven repositories.
It provides means for getting the most recent versions of a software package from arbitrary
Maven repositories.

## Basic use

```java
String group = "...";
String artifactName = "...";
String currentVersion = "...";

UpdateChecker updateChecker = new UpdateChecker(group, artifactName, currentVersion);
updateChecker.useMavenRepos(repo1, repo2, ...);

if (updateChecker.getStatus() == UpdateStatus.OUTDATED) {
updateChecker.getMostRecentArtifact().ifPresent(artifact -> {
System.out.println("The most recent artifact is version " + artifact.getVersion()
+ " on Maven repo " + artifact.getMavenRepo());
});
updateChecker.getMostRecentArtifactLocation().ifPresent(url -> {
System.out.println("The most recent artifact can be downloaded at " + url);
});
}
```