Skip to content

Version Sources and Comparison

Jeremy Fail edited this page Apr 4, 2026 · 2 revisions

Constructors (where “latest” comes from)

Constructor Remote “latest”
PluginUpdateChecker(JavaPlugin, String githubOwnerRepo) GitHub Releases API: tag_name of the first release in the array. Empty array → IOException (“no GitHub release found”).
PluginUpdateChecker(JavaPlugin, URL plainTextVersionUrl) HTTP GET; first non-empty line after trim.
PluginUpdateChecker(JavaPlugin, RemoteVersionSupplier) Your code; may throw IOException. Must not use the Bukkit API (runs on an async thread).

Built-in HTTP uses HttpURLConnection with the User-Agent and connect timeout you configure on the checker (see Checks, scheduler, and HTTP).

Installed version

  • Read from plugin.getDescription().getVersion() (trimmed) unless you call setInstalledVersion(String); null clears the override.

Ordering and sanity filter

  • Ordering: Maven-style via org.apache.maven.artifact.versioning.ComparableVersion (segments and qualifiers, not plain lexicographic string order).
  • Sanity filter: If the remote string is not strictly newer than installed, the outcome is running latest (avoids false “update” from odd API data).

Static helper

  • PluginUpdateChecker.isRemoteVersionNewer(String installed, String remote) - true only if remote compares strictly newer than installed.

Equivalent logic: VersionCompare.isRemoteNewerThanInstalled.

Clone this wiki locally