Get Model Package

0
Hi,I want to get the package name and display it in the UI of the app, exactly like I do with the Model version via GetModelVersion Java action. Is there a way to achieve this? I can't find anything in the documentation or on the forum.Thanks !
asked
3 answers
1

Hi Cojocaru Razvan


No Mendix does not provide any API to get the MDA package name at runtime. The only thing you can retrieve directly is the model version, using Core.getModelVersion() or Community Commons’ GetModelVersion.

1. Easiest: Add a Constant (manually or via pipeline)

Create a constant: AppInfo.PackageLabel = "Release_1.0.3_20260226" → Show it on your UI.

2. Best (if using Mendix Cloud):

Call Deploy API Once The Deploy API lets you read the currently deployed package (including its name/version). Flow (super simple): After Startup → REST Call to Deploy API → store "PackageName" in a small NPE → Show it in UI Do this once, not every request.


I hope this helps

answered
1

Cojocaru

It looks like this API call returns the package name: https://docs.mendix.com/apidocs-mxsdk/apidocs/deploy-api/#retrieve-environment-package Does this help?


Mike

answered
1

hi,


No, there is no supported API to retrieve the “Model Package name” at runtime in the same way you can retrieve the Model Version.

Let me explain why.

Why GetModelVersion Works

The GetModelVersion Java action works because the Mendix Runtime exposes the model version as part of the runtime metadata. This information is embedded in the deployed model and made available through the Core API.

The model version is part of the runtime’s accessible metadata.

Why Model Package Name Is Not Available

The “Model Package” (for example, the .mda package name generated during deployment) is:

  • A deployment artifact
  • Managed at build/deploy time
  • Not exposed via the Mendix Core runtime API

There is currently:

  • No documented Core API method
  • No Java action in the standard libraries
  • No supported reflection mechanism

to retrieve the package filename of the deployed model.

The runtime simply loads the model; it does not expose the original deployment package name.

What You Can Do Instead

If your goal is to display deployment-related information in the UI, you have a few supported alternatives:

1. Use the Model Version (Recommended)

Continue using GetModelVersion, which is the officially supported way to display version information.

2. Store Package Information Manually

If you need to display a package or build identifier:

  • Create a constant (e.g., AppPackageName)
  • Set it per environment during deployment
  • Display that constant in the UI

This is the cleanest and most maintainable approach.

3. Use Environment Variables

In Mendix Cloud or other environments, you can:

  • Define a custom environment variable (e.g., APP_PACKAGE_NAME)
  • Read it via System.getenv() in a Java action
  • Expose it to the UI

This is commonly used in enterprise CI/CD pipelines.

Important Architectural Note

In Mendix, deployment artifacts (.mda files) are considered infrastructure-level concerns. The runtime intentionally abstracts away build-level metadata.

For that reason, runtime access to the model package name is not supported.


Conclusion

It is not possible to retrieve the deployed model package name programmatically via Mendix runtime APIs.

If you need package identification in the UI, the recommended approach is to:

  • Use GetModelVersion for versioning
  • Or inject deployment metadata through constants or environment variables

This aligns with Mendix platform design and supported runtime capabilities.

answered