I'm searching for a more elegant to retrieve JBoss AS / WildFly major version number from command line, independent if server is running or not.
Currently I have:
- Oldest version is 4.2. So 4 is the default value.
- If directory $JBOSS_HOME/standalone exists, version must be >= 7. Change value to 7.
- If $JBOSS_HOME/modules/system/layers/base/io/undertow exists, it's version 8 or upper. Change value to 8.
Now I want to distinguish between 8 and 9. How?
Any better way?
Must be working on Windows and Unix platforms.
if you are doing this based on presence of some modules or not, then try checking if org.wildfly.extension.picketlink module exist, as this one is new in 9.
Otherwise you could check org.jboss.as.version module, where you can get exact information...