npskirk
npskirk

Reputation: 1188

Read a Liferay plugin's own liferay-plugin-package.properties from code in the plugin

How can a plugin's code get access to the properties set in its own liferay-plugin-package.properties file?

Upvotes: 2

Views: 857

Answers (1)

rp.
rp.

Reputation: 3465

You can use DeployManagerUtil

First import the following:

import com.liferay.portal.kernel.deploy.DeployManagerUtil;
import com.liferay.portal.kernel.plugin.PluginPackage;

Second use it:

PluginPackage pluginPackage = DeployManagerUtil.getInstalledPluginPackage("context-name");

String version = pluginPackage.getModuleId();
String pageURL = pluginPackage.getPageURL();

Upvotes: 3

Related Questions