TWCable / gradle-plugin-scr

Makes it easier to work for with the Felix SCR annotations for Gradle
Apache License 2.0
4 stars 2 forks source link

Skip interface reference check / default value #6

Closed pun-ky closed 8 years ago

pun-ky commented 8 years ago

Thanks for skip interface check:

   plugins.withId 'com.twcable.scr', {
        processScrAnnotations {
            skipInterfaceReferenceCheck = true
        }
    }

but without overriding it, error quite often occur but I am not sure if it is good to have it enabled by default. Maybe make whole plugin more fail-safe by setting this to true by default.

jdigger commented 8 years ago

Sorry for the delayed response, @pun-ky.

Verifying the interface check is there because that's how OSGi is "supposed" to work: You retrieve services via their interfaces. The OSGi specs certainly lean that way, the underlying mechanics of the SCR annotations and Declarative Services are heavily interface driven, and Felix is able to do various optimizations when working with interfaces. While Felix is forgiving and allows you to not use interfaces for everything for programmer ease and convenience, it's not the "right" way to do things.

For what it's worth, I've worked on several very large CQ/AEM projects and have never had to turn this option on...