Class EngineVersion
Read at class-init from this artifact's own
META-INF/maven/com.wualabs/qtsurfer-engine-common/pom.properties — the file the Maven JAR plugin
writes into every artifact by default. Deliberately not a build-time constant, a system property
or a MANIFEST.MF attribute:
- A constant can drift from the jar that is actually loaded (stale overlay, hand-patched image, transitive bump); reading the jar's own metadata cannot.
Package.getImplementationVersion()returnsnullhere — the engine build does not enableaddDefaultImplementationEntries, soMANIFEST.MFcarries noImplementation-Version.
Survives shading: the deployable fat jars of the consuming services filter only
META-INF/*.SF|DSA|RSA signature files, leaving META-INF/maven/** intact.
Audience
Both platform and user strategies. It sits in com.wualabs.qtsurfer.engine
itself, which the backend's strategy sandbox allows wholesale, so a strategy can simply:
import com.wualabs.qtsurfer.engine.EngineVersion;
String engine = EngineVersion.get(); // e.g. "0.99.53"
if (EngineVersion.getPatch() >= 53) { // 0 / 99 / 53
// ...
}
Why it exists (2026-07-25): engine 0.99.51 deleted StateStoreSupport, which
silently broke every stored strategy written against the older listener contract. Making the
running engine version legible — from a health endpoint, from a strategy, and eventually recorded
alongside each stored strategy's source — is what turns that class of break from mysterious into
diagnosable.
Resolution never throws: an unresolvable version yields UNKNOWN — and UNKNOWN_COMPONENT from the numeric accessors — so a caller such as a health endpoint degrades
to reporting "unknown" rather than failing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringReported when the version metadata cannot be read.static final intReported bygetMajor(),getMinor()andgetPatch()whenget()is not a parseablemajor.minor.patchversion — including when it isUNKNOWN. -
Method Summary
-
Field Details
-
UNKNOWN
-
UNKNOWN_COMPONENT
public static final int UNKNOWN_COMPONENTReported bygetMajor(),getMinor()andgetPatch()whenget()is not a parseablemajor.minor.patchversion — including when it isUNKNOWN. Negative on purpose: a version gate such asgetPatch() >= 53then fails closed rather than matching by accident.- See Also:
-
-
Method Details
-
get
-
getMajor
public static int getMajor() -
getMinor
public static int getMinor() -
getPatch
public static int getPatch()The patch component ofget()(the53of"0.99.53"), orUNKNOWN_COMPONENT. Any build qualifier (-SNAPSHOT, …) is ignored.
-