weixin_39941721
weixin_39941721
2020-12-29 00:39

Warning "Unable to determine whether the annotation .. applied to type ... is a component property type as it is not on the project build path." for dependencies

With bnd 4.1 (used together with maven-bundle-plugin) I see the following warnings when building https://github.com/Adobe-Consulting-Services/acs-aem-commons/:


[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Component applied to type com.day.cq.wcm.core.contentfinder.ContentFinderListInfoProviderHelper is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Reference applied to type com.day.cq.wcm.core.contentfinder.ContentFinderListInfoProviderHelper is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Reference applied to type com.day.cq.commons.servlets.AbstractPredicateServlet is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Component applied to type com.day.cq.commons.servlets.AbstractPredicateServlet is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Activate applied to type com.adobe.cq.dialogconversion.AbstractDialogRewriteRule is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Component applied to type com.adobe.cq.dialogconversion.AbstractDialogRewriteRule is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Component applied to type com.day.cq.wcm.workflow.process.ActivatePageProcess is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Service applied to type com.day.cq.wcm.workflow.process.ActivatePageProcess is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Property applied to type com.day.cq.wcm.workflow.process.ActivatePageProcess is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Reference applied to type com.day.cq.wcm.workflow.process.ReplicatePageProcess is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Component applied to type com.day.cq.wcm.workflow.process.ReplicatePageProcess is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Component applied to type com.day.cq.wcm.workflow.process.DeactivatePageProcess is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Service applied to type com.day.cq.wcm.workflow.process.DeactivatePageProcess is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed
[WARNING] Manifest com.adobe.acs:acs-aem-commons-bundle:bundle:3.19.1-SNAPSHOT : Unable to determine whether the annotation org.apache.felix.scr.annotations.Property applied to type com.day.cq.wcm.workflow.process.DeactivatePageProcess is a component property type as it is not on the project build path. If this annotation is a component property type then it must be present on the build path in order to be processed

The warnings are issued for classes which are dependencies and not classes in the target directory. IMHO those dependencies are not worth to be evaluated for component property types as you never generate metadata for those. Therefore the WARNINGs should IMHO be prevented.

该提问来源于开源项目:bndtools/bnd

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

9条回答

  • weixin_39941721 weixin_39941721 4月前

    Thanks a lot for your answer, but actually the class com.day.cq.wcm.core.contentfinder.ContentFinderListInfoProviderHelper is not embedded in the JAR. Compare with the attached screenshot: screenshot 2019-02-01 at 11 50 38

    Still it appears in the WARNING!

    点赞 评论 复制链接分享
  • weixin_39941721 weixin_39941721 4月前

    At least for ActivatePageProcess I found the reason: There is a component in https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/a4ad6c31263588286cb5380a3919675a64707e1c/bundle/src/main/java/com/adobe/acs/commons/workflow/process/impl/ParameterizedActivatePageProcess.java#L38 which extends from it. Can we bring bnd somehow to not evaluate the parent classes for annotations?

    点赞 评论 复制链接分享
  • weixin_39963440 weixin_39963440 4月前

    Can we bring bnd somehow to not evaluate the parent classes for annotations?

    Not scanning parent classes is the default behaviour for bnd, however this project has deliberately enabled scanning of parent classes. https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/84f76f7faccca34062008ea61499e2dd201c7a90/bundle/pom.xml#L79

    点赞 评论 复制链接分享
  • weixin_39941721 weixin_39941721 4月前

    Thanks a lot again, indeed after disabling inheritance all those warnings disappeared.

    点赞 评论 复制链接分享
  • weixin_39880301 weixin_39880301 4月前

    Add the necessary annotations to the build path so that bnd can do its job

    Hi, how can I add the annotations to the build path? I'm using gradle with biz.aQute.bnd.workspace and biz.aQute.bnd plugins and I've tried to set my dependencies to implementation, compileOnly and runtimeOnly but my warnings persist.

    点赞 评论 复制链接分享
  • weixin_39805539 weixin_39805539 4月前

    IIUC and you are using biz.aQute.bnd.workspace then you should not use gradle dependency management but rather bnd's workspace dependency management which would have you:

    a) make sure the dependency is referred to by one of the bnd repositories (look in cnf dir for those typically) b) refer to the dependency from the project's bnd.bnd file on the -buildpath instruction

    Pointing at the repository in question might make it easier for us to point out the issue.

    点赞 评论 复制链接分享
  • weixin_39880301 weixin_39880301 4月前

    Thanks for such a quick answer! I'm very new to OSGi and bndtools. I'm learning and trying to piece all the knowledge and tools together. Maybe it would help to just link the repository: https://github.com/marad/personal-sidecar (the subproject that gives me most of those errors is obsidian-startpage)

    I'm building it with ./gradlew build, but I'm not sure if I should use that or the bnd tool to build the workspace?

    点赞 评论 复制链接分享
  • weixin_39812465 weixin_39812465 4月前

    I'm very new to OSGi and bndtools.

    It would be better to move usage questions to the bndtools-users mail list. See https://github.com/bndtools/bnd#feedback.

    点赞 评论 复制链接分享
  • weixin_39963440 weixin_39963440 4月前

    These warnings are valid, and important information that is being provided to you.

    The warnings are issued for classes which are dependencies and not classes in the target directory.

    In this case the bundle being built is embedding classes from other jars/bundles on the class path, as configured in the bundle pom file. If the classes end up in the bundle then they need to be scanned and processed by bnd, regardless of where they came from. You would rightly be upset if bnd ignored the dependencies added by the embedded code!

    These embedded classes are annotated with annotations that make them relevant for Declarative Services metadata generation, and so the annotation hierarchy needs to be checked. Unfortunately the annotations themselves are not on the build path (which is what the warning is complaining about). In this case bnd needs the information to do its job properly (i.e. to create the relevant DS metadata for these components.

    Therefore this project needs to either:

    • Add the necessary annotations to the build path so that bnd can do its job
    • Tell bnd not to generate Declarative Services Metadata for the embedded classes

    Note that the latter option will result in no Declarative Services XML descriptors being generated for those types, which may, or may not, be a problem for you, depending on whether the bundle being built expects the components it embeds to be used as components.

    点赞 评论 复制链接分享

相关推荐