Blacklists are used for good and evil. An evil blacklist penalizes unfairly; a good blacklist protects. Liferay DXP’s OSGi module and component blacklists are files that prevent particular modules from installing and particular components from enabling. This saves you the trouble of uninstalling and disabling them individually with the Application Manager, Components list, or Gogo shell.
Blacklisting Modules
Liferay DXP removes any installed modules on the blacklist. Blacklisted modules therefore can’t be installed. The log reports each module uninstallation.
Follow these steps to blacklist modules:
-
In the Control Panel, navigate to Configuration → System Settings → Module Container.
-
In the Bundle Blacklist screen, add the bundle symbolic names (see the table below) for the OSGi module JARs, LPKGs, or WARs to uninstall. Click the Save button when you’re finished.
-
To export the blacklist, click its Actions button () and then click Export. The blacklist configuration file then downloads (
com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration.config
). Here are contents from an example file:blacklistBundleSymbolicNames=["com.liferay.docs.greeting.api","Liferay\ Marketplace","classic-theme"]
-
Add the bundle symbolic names of any modules not already listed that you want to prevent from installing.
Important: Configuration values can’t contain extra spaces. Extra spaces can short-circuit lists or invalidate the configuration entry.
-
To deploy the configuration file, copy it into the folder
[Liferay_Home]/osgi/configs
. The Liferay Home folder is typically the app server’s parent folder.
Blacklist Bundle Symbolic Names
Type | Bundle Symbolic Name |
---|---|
Module JAR | Bundle-SymbolicName in bnd.bnd or MANIFEST.MF file |
LPKG | LPKG file name without the .lpkg extension |
WAR | Servlet context name in liferay-plugin-package.properties file or the WAR file name (minus .war ), if there is no servlet context name property |
Reinstalling Blacklisted Modules
To reinstall and permit installation of blacklisted modules, follow these steps:
-
Open the configuration file
com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration.config
. -
Remove the symbolic names of the modules, LPKGs, or WARs from the
blacklistBundleSymbolicNames
list and save the file.
To reinstall all the blacklisted modules execute one of these options:
- Remove the configuration file.
- Uninstall the module
com.liferay.portal.bundle.blacklist
using the Application Manager or Felix Gogo Shell.
The log reports each module installation.
Blacklisting Components
Follow these steps to blacklist components:
-
In the Control Panel, navigate to Configuration → System Settings → Module Container.
-
In the Component Blacklist Configuration screen, add the names of components to disable and click the Save button.
-
To export the blacklist, click on the Component Blacklist Configuration module’s Actions button () and then click Export. The blacklist configuration file then downloads (
com.liferay.portal.component.blacklist.internal.ComponentBlacklistConfiguration.config
). Here are contents from an example file:blacklistComponentNames=["com.liferay.portal.security.ldap.internal.authenticator.LDAPAuth","com.liferay.ip.geocoder.sample.web.internal.portlet.IPGeocoderSamplePortlet "]
-
Add the names of any components not already listed (e.g., components of modules not yet installed) that you want to prevent from activating.
Important: Configuration values can’t contain extra spaces. Extra spaces can short-circuit lists or invalidate the configuration entry.
-
To deploy the configuration file, copy it into the folder
[Liferay_Home]/osgi/configs
. The Liferay Home folder is typically the app server’s parent folder.
Re-enabling Blacklisted Components
To re-enable and permit enabling of blacklisted components, follow these steps:
-
Open the configuration file
com.liferay.portal.component.blacklist.internal.ComponentBlacklistConfiguration.config
. -
Remove the names of the components from the
blacklistComponentNames
list and save the file.
To enable all the blacklisted components, remove the configuration file.