Retrieve Jmix Version Programmatically?

Jmix 2.4.1
Is is possible to retrieve the version of jmix? I would like to include it in my Help > About.

1 Like

Yes it’s possible.

Add the following to your build.gradle:

afterEvaluate {
    tasks.named('bootBuildInfo') {
        properties {
            additional = [
                    'jmix.version': jmix.bomVersion
            ]
        }
    }
}

Then in the application you can use the org.springframework.boot.info.BuildProperties bean:

@Autowired
private BuildProperties buildProperties;

private String getJmixVersion() {
    return buildProperties.get("jmix.version");
}

Regards,
Konstantin

1 Like