Embedding scanner-annotations is not supported since scanner version 2.0

plugin-sdk
plugin-development

#1

What could be the possible cause of a custom plugin which was working fine before rebooting BBS having this error logged.

'2018-07-17 03:49:29,959 ERROR [ThreadPoolAsyncTaskExecutor::Thread 32] c.a.plugin.osgi.factory.OsgiPlugin Unable to start the plugin container for plugin 'com.plugin.jenkins'
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [bundle://134.0:0/META-INF/spring/plugin-context.xml]; nested exception is java.lang.IllegalStateException: Cannot execute atlassian-spring-scanner-runtime: plugin has an extra copy of atlassian-spring-scanner-annotation classes, perhaps embedded inside the target plugin 'com.plugin.jenkins'; embedding scanner-annotations is not supported since scanner version 2.0. Use 'mvn dependency:tree' and ensure the atlassian-spring-scanner-annotation dependency in your plugin has <scope>provided</scope>, not 'runtime' or 'compile', and you have NO dependency on atlassian-spring-scanner-runtime.

Any highlight on this ?


#2

Hey there,

This is quite a strange error and should not happen just because of rebooting, but it seemed to have happened to you.

A long shot to solve this might be to clear the plugin caches directory.
If this is not helping can you check if you don’t bundle the scanner-annotations in your pom? Following the steps in the error might help. Or if you want some more info around the atlassian- spring-scanner you can find it here https://bitbucket.org/atlassian/atlassian-spring-scanner/src/master/