The last time WildFly updated the domain namespace in the configuration file was with WildFly 27 (Version 20.0). There has been no change since then, so OfflineServerVersion reports version 20.0 for WildFly 27 (currently -33). Version updates are no longer needed after WFCORE-5640.
<server xmlns="urn:jboss:domain:20.0">
One option to get a version might be
URLClassLoader cl = new URLClassLoader(new URL[] {"server_root/modules/.../.../wildfly-version".toURI().toURL()},
this.getClass().getClassLoader()
);
Class<?> versionClass = Class.forName("org.jboss.as.version.Version", true, cl);
Field majorVersionField = versionClass.getDeclaredField("MANAGEMENT_MAJOR_VERSION");
return majorVersionField.getInt(null);
but Creaper doesn't always have path to the server, only path to configuration file be used.
Another approach might be adding support for versioned subsystems instead of relying on the root version.
Or only documenting current behavior and leaving it to OfflineCommand implementations to handle different subsystems versions. One example is #235
stringSubsystemValues = datasources.'@xmlns'.text().tokenize(":")[-1].tokenize(".")
major = stringSubsystemValues[0].toInteger()
minor = stringSubsystemValues[1].toInteger()
securityParamsAsElements = major <= 7 && minor < 2
The last time WildFly updated the domain namespace in the configuration file was with WildFly 27 (Version 20.0). There has been no change since then, so
OfflineServerVersionreports version 20.0 for WildFly 27 (currently -33). Version updates are no longer needed after WFCORE-5640.One option to get a version might be
but Creaper doesn't always have path to the server, only path to configuration file be used.
Another approach might be adding support for versioned subsystems instead of relying on the root version.
Or only documenting current behavior and leaving it to
OfflineCommandimplementations to handle different subsystems versions. One example is #235