Fix Gradle workspace for OSGi configuration modules

If you are using Gradle workspace for Liferay 7.2 and developing a module with OSGi configuration,
for example:


@ExtendedObjectClassDefinition(category = ConfigurationKeys.CATEGORY_KEY, scope = ExtendedObjectClassDefinition.Scope.COMPANY)
@Meta.OCD(id = ConfigurationKeys.REST_CONFIGURATION, localization = "content/Language", name = "rest-configuration")
public interface RestConfiguration {
   @Meta.AD(deflt = "https://lifedev.com/api/v1", name = "rest-endpoint")
   public String restEndpoint();
   @Meta.AD(deflt = "0 * * ? * *", name = "cronjob-expression")
   public String cronjobExpression();
}

, you may notice that your configuration does not appear in Control Panel,
even if code/configuration seems to be correct.


The issue may be related to gradle plugins workspace version.


Check "com.liferay.gradle.plugins.workspace" property in settings.gradle file. If it’s higher than 2.0.0 (for example, 2.0.3) - try to downgrade it:

classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "2.0.0"

Rebuild/redeploy your module after updating configuration, and check if that helps.

Comments

Popular posts from this blog

Liferay Search Container Example

Liferay DXP - max upload file size

Liferay Keycloak integration