Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>With 5 there is a properties file: /org/jboss/version.properties where the keys version.major and version.minor looks for your case. Sust load the file to Properties and read. See link below: </p> <p><a href="http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/releases/org.jboss.jbossas/jboss-as-main/5.0.0.CR2/org/jboss/version.properties" rel="nofollow">http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/releases/org.jboss.jbossas/jboss-as-main/5.0.0.CR2/org/jboss/version.properties</a></p> <p>This file has been kept also in jboss6.1 </p> <p><a href="http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/releases/org.jboss.jbossas/jboss-as-main/6.1.0.Final/org/jboss/version.properties?av=f" rel="nofollow">http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/releases/org.jboss.jbossas/jboss-as-main/6.1.0.Final/org/jboss/version.properties?av=f</a></p> <p>I realized you asked for jboss7.... but I leave the work I did in case can be useful (it is anyway an approach valid for 5 and 6 versions) For jboss7 I found two ways: </p> <p>WAY 1<br> Checking out the code from github I <strong>cannot find anymore this Versoin.properties</strong> in the sources. But I could find a Version.class which stores the version and release code name as properties; you can use Version.AS_VERSION to get what you want as you can see from the source code: </p> <pre><code> public class Version { public static final String AS_VERSION; public static final String AS_RELEASE_CODENAME; public static final int MANAGEMENT_MAJOR_VERSION = 1; public static final int MANAGEMENT_MINOR_VERSION = 4; public static final int MANAGEMENT_MICRO_VERSION = 0; static { InputStream stream = Version.class.getClassLoader().getResourceAsStream("META-INF/MANIFEST.MF"); Manifest manifest = null; try { if (stream != null) manifest = new Manifest(stream); } catch (Exception e) { } String version = null, code = version; if (manifest != null) { version = manifest.getMainAttributes().getValue("JBossAS-Release- Version"); code = manifest.getMainAttributes().getValue("JBossAS-Release-Codename"); } if (version == null) { version = "Unknown"; } if (code == null) { code = "Unknown"; } AS_VERSION = version; AS_RELEASE_CODENAME = code; } </code></pre> <p>} </p> <p>WAY2 </p> <p>Another option that I found googling but I didn't verify personally is going through JMX (perhaps you prefer this approach): </p> <pre><code> ModelControllerClient client = ModelControllerClient.Factory.create(InetAddress.getByName("localhost"), 9999); ModelNode op = new ModelNode(); op.get(ClientConstants.OP).set("read-resource"); ModelNode returnVal = client.execute(op); logger.info("release-version: " + returnVal.get("result").get("release-version").asString()); logger.info("release-codename: " + returnVal.get("result").get("release-codename").asString()); </code></pre> <p>And from the jboss-admin command line interface, you can get the info from these commands: /:read-attribute(name=release-version)<br> /:read-attribute(name=release-codename) </p> <p>NOTE: </p> <p>The source code are now under git clone <a href="https://github.com/wildfly/wildfly.git" rel="nofollow">https://github.com/wildfly/wildfly.git</a> (the jboss website still send to an outdated link)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload