0

I'm Migrating from Apache Felix SCR Annotations to OSGI Declarative Services and here is my Problem.

Before I had: SCR annotation Implementation

@Component (ds = true, immediate = true, metatype = false, policy = ConfigurationPolicy.OPTIONAL)
@Service (SampleService.class)
public class SampleServiceImpl implements SampleService
{
 ..
 ..
}

Now I have : DS annotation Implementation

@Component (configurationPolicy = ConfigurationPolicy.OPTIONAL, immediate = true, service = SampleService.class)
public class SampleServiceImpl implements SampleService
{
 ..
 ..
}

In DS annotation Implementation How i have to map ds and metatype params?

Else it is fine to ignore ds and metatype params?

Kamalraj
  • 17
  • 5
  • Do you use Maven plugin to process those annotations? What maven plugin do you use, if any? – wilx Nov 08 '22 at 20:52

1 Answers1

1

ds=true as well as metatype=false are the defaults anyway. You can safely ignore them in your case.

Christian Schneider
  • 19,420
  • 2
  • 39
  • 64
  • Thanks @Christian Schneider. Similarly how can map **specVersion ** in DS annotation Implementation? – Kamalraj Apr 20 '21 at 13:08
  • Specversion in DS is partly defined by the spec you use as maven dependency and partly by the features you use. Simply leave this attribute out in DS. – Christian Schneider Apr 21 '21 at 15:09