2

My problem in practice:

@Property(name = "someProperty", intValue = 0)

The annotation above generates:

<AD id="someProperty" type="Integer" default="0" .../>

Can I specify the @Property annotation in the way that the "type" will be "Integer" but there will be no default value? The sample is with Integer, but the question is the same with all non-String type.

In case it is possible with other annotation set (like the one coming from BndLib) I am interested in that solution as well. However, maven support is very important to me. With felix-scr-plugin there is m2e lifecycle mapping so the XML file is always up-to-date in the target/classes folder.

Balazs Zsoldos
  • 6,036
  • 2
  • 23
  • 31
  • The annotations in bnd work in Maven of course. In fact because they are built into bnd, they are part of the basic maven-bundle-plugin and you do not need a separate plugin for SCR generation. – Neil Bartlett Nov 11 '13 at 08:09
  • I see that if I give the Service-Component:* instruction the plugin generates the necessary XML into the JAR. Is there a way to make the XML generated into the target/classes in the way that it is updated always when I save a class with an annotation? I normally deploy the target/classes folder into the OSGi container so I do not have to do a full rebuild in case I need to update the bundle. That is why the m2e-lifecycle mapping is so important to me. – Balazs Zsoldos Nov 11 '13 at 09:30
  • No, but if you need to update the bundle then you clearly need to build the bundle, at which point the XML will be generated. Not sure why it's necessary to have the XML appear under target/classes. – Neil Bartlett Nov 11 '13 at 10:24
  • I have a simple bundle that opens up an always-on-top window. I can d&d any maven project onto that window and it will install/update bundle from target/classes folder. As with maven-bundle-plugin with M2E the MANIFEST.MF file is always up-to-date, I do not have to rebuild the jar but just d&d the project from Eclipse onto the swing window. This speeds up the development a lot as I can d&d the project right after saving any of the files. This is why it is so important to me to have m2e-lifecycle-mapping. – Balazs Zsoldos Nov 11 '13 at 10:31
  • BtW: I know that this speed of development iterations could be done with BndTools, but we are really maven based :). – Balazs Zsoldos Nov 11 '13 at 10:35

0 Answers0