RE: Configuration not working on LR 7.2

Marco Volpe, modified 6 Years ago. New Member Posts: 7 Join Date: 8/30/16 Recent Posts
Hi
Some months ago I developed a configuration bundle for LR 7.1 CE, then installed then on Liferay DXP, that correctly works.
I'm trying the same on LR 7.2 CE but it doesn't work, the configuration items missing in System Settings.
I followed the guide at this link
https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/configurable-applications

I noticed that inside the jar, the folder OSGI-INF/metatype is missing, so any xml configuration file was inside the bundle.
I created the interface 
import com.liferay.portal.configuration.metatype.annotations.ExtendedObjectClassDefinition;
import aQute.bnd.annotation.metatype.Meta;
@ExtendedObjectClassDefinition(
        scope = ExtendedObjectClassDefinition.Scope.COMPANY
    )
@Meta.OCD(
        id = TestBaseConfiguration.Id,
        localization = "content/Language"        
        )
public interface TestBaseConfiguration {
    public static final String Id = "it.test.configuration.TestBaseConfiguration";
​​​​​​​    
    @Meta.AD(
            name = "enable-send-mail",
            deflt = "false",
            required = false
            )
    public boolean enableSendMail();
}


The "id" property contains the fqn of the class. Then, inside the bnd.bnd I added the following line

-metatype: *

Can you help me?
Thanks
Marco
thumbnail
Christoph Rabel, modified 6 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
That happens since Liferay workspace 2.0.3,  support of various annotations was removed in bnd 4.x and with that version Liferay started to use bnd 4.2.
It works with: classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "2.0.2"
You could also try 2.0.6, but I don't know if the issue is already fixed.
Marco Volpe, modified 6 Years ago. New Member Posts: 7 Join Date: 8/30/16 Recent Posts
Great! Now it works.

Thank you very much!
thumbnail
Olaf Kock, modified 5 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
There's no more need to downgrade, you can also use a more recent (rather than an older) version of Liferay Workspace.
Edit your settings.gradle to include a newer version of Liferay Workspace. 2.1.9 works for me, but check the link for the current version