OSGI requirement issue - jersey.repackaged

Trying to build/deploy a Confluence plugin, but I can’t seem to get passed this OSGI requirement no matter how hard I try. I’ve literally been getting these OSGi warning and then just adding the relevant Maven dependency to clear it. Feel like I’m not going about this properly. Complains about missing
jersey.repackaged.com.google.common.cache.LocalCache.jersey.repackaged.com.google.common.cache

[INFO] [talledLocalContainer] Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle com.my.confluence.MyPlugin [264]: Unable to resolve 264.0: missing requirement [264.0] osgi.wiring.package; (osgi.wiring.package=com.my.confluence.myplugin.api) [caused by: Unable to resolve 263.0: missing requirement [263.0] osgi.wiring.package; (osgi.wiring.package=jersey.repackaged.com.google.common.cache.LocalCache.jersey.repackaged.com.google.common.cache)]

Below is my Maven dependency tree. I have called out the lines with “<—” that I added to satisfy the requirement but at runtime in Confluence, I get the above error. Any ideas?

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ MyPlugin ---
[INFO] com.my.confluence:MyPlugin:atlassian-plugin:1.0.0-SNAPSHOT
[INFO] +- junit:junit:jar:4.10:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.1:provided
[INFO] +- com.atlassian.confluence:confluence:jar:6.6.0:provided
[INFO] |  +- com.atlassian.filestore:dt-filestore-httpclient:jar:1.3.0:provided
[INFO] |  |  +- com.atlassian.filestore:dt-filestore-client-api:jar:1.3.0:provided
[INFO] |  |  \- com.atlassian.filestore:dt-filestore-client-core:jar:1.3.0:provided
[INFO] |  |     \- org.bitbucket.b_c:jose4j:jar:0.4.2:provided
[INFO] |  +- com.atlassian.media:dt-media-api-httpclient:jar:2.0.4:provided
[INFO] |  |  +- com.atlassian.media:dt-media-api-client-api:jar:2.0.4:provided
[INFO] |  |  \- com.atlassian.media:dt-media-api-client-core:jar:2.0.4:provided
[INFO] |  +- com.atlassian.security:atlassian-secure-xml:jar:3.2.4:provided
[INFO] |  +- org.xerial.snappy:snappy-java:jar:1.1.1.7:provided
[INFO] |  +- com.atlassian.crowd:embedded-crowd-api:jar:2.10.3:provided
[INFO] |  |  \- com.atlassian.annotations:atlassian-annotations:jar:0.14:provided
[INFO] |  +- com.atlassian.crowd:crowd-events:jar:2.10.3:provided
[INFO] |  |  \- com.atlassian.crowd:crowd-api:jar:2.10.3:provided
[INFO] |  +- com.atlassian.crowd:crowd-core:jar:2.10.3:provided
[INFO] |  |  +- com.atlassian.crowd:crowd-ldap:jar:2.10.3:provided
[INFO] |  |  |  \- com.google.code.findbugs:annotations:jar:3.0.0:provided
[INFO] |  |  +- com.atlassian.crowd:crowd-persistence-file:jar:2.10.3:provided
[INFO] |  |  +- com.atlassian.security:atlassian-secure-random:jar:3.2.4:provided
[INFO] |  |  +- com.atlassian.crowd:crowd-core-tiny:jar:2.10.3:provided
[INFO] |  |  +- org.apache.httpcomponents:httpclient:jar:4.5.1:provided
[INFO] |  |  |  \- org.apache.httpcomponents:httpcore:jar:4.4.3:provided
[INFO] |  |  \- org.springframework:spring-beans:jar:3.2.10.RELEASE:provided
[INFO] |  +- com.atlassian.crowd:crowd-integration-api:jar:2.10.3:provided
[INFO] |  +- com.atlassian.crowd:crowd-integration-seraph:jar:2.10.3:provided
[INFO] |  |  \- com.atlassian.crowd:crowd-integration-client-common:jar:2.10.3:provided
[INFO] |  +- com.atlassian.crowd:embedded-crowd-spi:jar:2.10.3:provided
[INFO] |  +- com.atlassian.crowd:crowd-password-encoders:jar:2.10.3:provided
[INFO] |  |  +- com.atlassian.security:atlassian-password-encoder:jar:3.2.4:provided
[INFO] |  |  |  \- com.atlassian.security:atlassian-secure-utils:jar:3.2.4:provided
[INFO] |  |  \- org.springframework.security:spring-security-core:jar:3.2.5.RELEASE:provided
[INFO] |  +- com.google.code.findbugs:findbugs-annotations:jar:3.0.1:provided
[INFO] |  +- com.atlassian.crowd:atlassian-embedded-crowd-atlassian-user:jar:2.3.3:provided
[INFO] |  +- com.atlassian.crowd:embedded-crowd-core:jar:2.10.3:provided
[INFO] |  |  \- com.atlassian.crowd:crowd-remote:jar:2.10.3:provided
[INFO] |  |     \- com.atlassian.crowd:crowd-integration-client-rest:jar:2.10.3:provided
[INFO] |  |        \- org.apache.httpcomponents:httpclient-cache:jar:4.5.1:provided
[INFO] |  +- com.atlassian.crowd:crowd-query-language:jar:2.10.3:provided
[INFO] |  |  \- org.antlr:antlr-runtime:jar:3.5.2:provided
[INFO] |  +- com.atlassian.crowd:crowd-persistence:jar:2.10.3:provided
[INFO] |  +- org.springframework.ldap:spring-ldap-core:jar:2.2.1.RELEASE:provided
[INFO] |  |  +- org.springframework:spring-core:jar:4.3.4.RELEASE:provided
[INFO] |  |  \- org.springframework:spring-tx:jar:4.3.4.RELEASE:provided
[INFO] |  +- com.atlassian.confluence:confluence-upgrade:jar:6.6.0:provided
[INFO] |  |  \- com.atlassian.plugins:atlassian-plugins-api:jar:4.4.7:provided
[INFO] |  +- com.atlassian.gzipfilter:atlassian-gzipfilter:jar:3.0.0:provided
[INFO] |  |  \- com.atlassian.gzipfilter:atlassian-flushable-gzipoutputstream:jar:1.1:provided
[INFO] |  +- com.atlassian.analytics:analytics-api:jar:5.2.20:provided
[INFO] |  +- com.atlassian.applinks:applinks-api:jar:5.4.1:provided
[INFO] |  +- com.atlassian.applinks:applinks-spi:jar:5.4.1:provided
[INFO] |  +- com.atlassian.applinks:applinks-host:jar:5.4.1:provided
[INFO] |  +- com.atlassian.cluster.monitoring:cluster-monitoring-spi:jar:1.0.2:provided
[INFO] |  +- com.atlassian.dragonfly:dragonfly-api:jar:1.1:provided
[INFO] |  +- com.atlassian.dragonfly:dragonfly-spi:jar:1.1:provided
[INFO] |  +- com.atlassian.dragonfly:dragonfly-core:jar:1.1:provided
[INFO] |  +- com.atlassian.util.concurrent:atlassian-util-concurrent:jar:3.0.0:provided
[INFO] |  +- io.atlassian.util.concurrent:atlassian-util-concurrent:jar:4.0.1:provided
[INFO] |  +- com.atlassian.modzdetector:modz-detector:jar:0.14:provided
[INFO] |  +- com.atlassian.mail:atlassian-mail:jar:2.5.19:provided
[INFO] |  |  +- commons-logging:commons-logging:jar:1.0.4:provided
[INFO] |  |  \- com.atlassian:atlassian-localhost:jar:1.1.0:provided
[INFO] |  +- com.atlassian.velocity:atlassian-velocity:jar:1.3:provided
[INFO] |  +- com.atlassian.core:atlassian-core:jar:4.6.17:provided
[INFO] |  |  +- org.apache.sanselan:sanselan:jar:0.97-incubator:provided
[INFO] |  |  +- com.atlassian.image:atlassian-image-consumer:jar:1.0.1:provided
[INFO] |  |  \- javax.media:jai-core:jar:1.1.3:provided
[INFO] |  +- com.atlassian.config:atlassian-config:jar:1.0.1:provided
[INFO] |  +- com.atlassian.spring:atlassian-spring:jar:2.0.8:provided
[INFO] |  |  +- org.springframework:spring-jdbc:jar:2.0.6:provided
[INFO] |  |  |  \- org.springframework:spring-dao:jar:2.0.6:provided
[INFO] |  |  +- org.springframework:spring-context:jar:2.0.6:provided
[INFO] |  |  |  \- aopalliance:aopalliance:jar:1.0:provided
[INFO] |  |  \- org.springframework:spring-web:jar:2.0.6:provided
[INFO] |  +- com.atlassian.spring:atlassian-spring-hibernate2:jar:2.0.8:provided
[INFO] |  |  \- org.springframework:spring-hibernate2:jar:2.0.6:provided
[INFO] |  +- com.atlassian.event:atlassian-event:jar:3.1.5:provided
[INFO] |  +- com.atlassian.confluence:confluence-bucket:jar:6.6.0:provided
[INFO] |  +- com.atlassian.hibernate:atlassian-hibernate2-extras:jar:4.1.1:provided
[INFO] |  +- com.atlassian.xwork:atlassian-xwork-10:jar:1.20:provided
[INFO] |  +- com.atlassian.xwork:atlassian-xwork-core:jar:1.20:provided
[INFO] |  +- com.atlassian.profiling:atlassian-profiling:jar:2.0:provided
[INFO] |  +- com.atlassian.threadlocal:atlassian-threadlocal:jar:1.4:provided
[INFO] |  +- com.atlassian.trackback:atlassian-trackback:jar:0.10:provided
[INFO] |  +- com.atlassian.extras:atlassian-extras-core:jar:3.2:provided
[INFO] |  |  +- com.atlassian.extras:atlassian-extras-api:jar:3.2:provided
[INFO] |  |  +- com.atlassian.extras:atlassian-extras-common:jar:3.2:provided
[INFO] |  |  +- com.atlassian.extras:atlassian-extras-legacy:jar:3.2:provided
[INFO] |  |  |  \- com.atlassian.extras:atlassian-extras-decoder-api:jar:3.2:provided
[INFO] |  |  \- com.atlassian.extras:atlassian-extras-decoder-v2:jar:3.2:provided
[INFO] |  +- com.atlassian.ip:atlassian-ip:jar:3.1:provided
[INFO] |  +- com.atlassian.johnson:atlassian-johnson-core:jar:3.5.0:provided
[INFO] |  +- com.atlassian.html:atlassian-html-encoder:jar:1.5:provided
[INFO] |  +- com.atlassian.json:atlassian-json-jsonorg:jar:0.11:provided
[INFO] |  |  \- com.atlassian.json:atlassian-json-api:jar:0.11:provided
[INFO] |  +- com.atlassian.plugins:atlassian-plugins-core:jar:4.4.7:provided
[INFO] |  +- com.atlassian.plugins:atlassian-plugins-servlet:jar:4.4.7:provided
[INFO] |  +- com.atlassian.plugins:atlassian-plugins-webresource-common:jar:4.4.7:provided
[INFO] |  +- com.atlassian.plugins:atlassian-plugins-webfragment-api:jar:4.0.1:provided
[INFO] |  +- com.atlassian.plugins:atlassian-plugins-webfragment:jar:4.0.1:provided
[INFO] |  +- com.atlassian.plugins:atlassian-plugins-webresource:jar:3.5.19-ac3d947:provided
[INFO] |  |  +- com.atlassian.plugins:atlassian-plugins-webresource-spi:jar:3.5.19-ac3d947:provided
[INFO] |  |  +- com.atlassian.plugins:atlassian-plugins-webresource-api:jar:3.5.19-ac3d947:provided
[INFO] |  |  \- com.atlassian.sourcemap:sourcemap:jar:1.7.5:provided
[INFO] |  +- com.atlassian.plugins:atlassian-plugins-osgi:jar:4.4.7:provided
[INFO] |  |  +- com.atlassian.plugins:atlassian-plugins-osgi-events:jar:4.4.7:provided
[INFO] |  |  +- biz.aQute.bnd:biz.aQute.bndlib:jar:2.4.1:provided
[INFO] |  |  +- org.apache.felix:org.apache.felix.framework:jar:4.2.1:provided
[INFO] |  |  \- org.twdata.pkgscanner:package-scanner:jar:0.9.5:provided
[INFO] |  +- com.atlassian.plugins:atlassian-plugins-schema:jar:4.4.7:provided
[INFO] |  +- com.atlassian.plugins:atlassian-plugins-spring:jar:4.4.7:provided
[INFO] |  |  +- org.springframework:spring-expression:jar:4.2.4.RELEASE:provided
[INFO] |  |  +- org.springframework:spring-aop:jar:4.2.4.RELEASE:provided
[INFO] |  |  +- org.springframework:spring-context-support:jar:4.2.4.RELEASE:provided
[INFO] |  |  \- org.springframework:spring-webmvc:jar:4.2.4.RELEASE:provided
[INFO] |  +- com.atlassian.plugins:atlassian-spring-interceptor-adapter-spi:jar:1.1:provided
[INFO] |  +- com.atlassian.bandana:atlassian-bandana:jar:3.1:provided
[INFO] |  +- com.atlassian.user:atlassian-user:jar:3.0:provided
[INFO] |  +- com.atlassian.renderer:atlassian-renderer-legacy:jar:6.2.19:provided
[INFO] |  |  \- javax.activation:activation:jar:1.0.2:provided
[INFO] |  +- net.sourceforge.nekohtml:nekohtml:jar:1.9.22:provided
[INFO] |  +- com.atlassian.bonnie:atlassian-bonnie:jar:7.0.0:provided
[INFO] |  |  +- com.atlassian.bonnie:lucene-upgrader:jar:lucene36:1.0:provided
[INFO] |  |  +- org.apache.pdfbox:pdfbox:jar:2.0.6:provided
[INFO] |  |  |  \- org.apache.pdfbox:fontbox:jar:2.0.6:provided
[INFO] |  |  \- com.ibm.icu:icu4j:jar:3.8:provided
[INFO] |  +- org.bouncycastle:bcprov-jdk15on:jar:1.54:provided
[INFO] |  +- org.bouncycastle:bcmail-jdk15on:jar:1.54:provided
[INFO] |  |  \- org.bouncycastle:bcpkix-jdk15on:jar:1.54:provided
[INFO] |  +- com.atlassian.jdk.utilities:atlassian-jdk-utilities:jar:0.4:provided
[INFO] |  +- joda-time:joda-time:jar:2.9.9:provided
[INFO] |  +- com.atlassian.seraph:atlassian-seraph:jar:3.0.3:provided
[INFO] |  |  \- com.atlassian.security:atlassian-cookie-tools:jar:3.2.3:provided
[INFO] |  +- com.atlassian.security.auth.trustedapps:atlassian-trusted-apps-core:jar:4.1.0:provided
[INFO] |  +- com.atlassian.security.auth.trustedapps:atlassian-trusted-apps-seraph-integration:jar:4.1.0:provided
[INFO] |  +- com.atlassian.plugins:avatar-plugin-api:jar:1.3.5:provided
[INFO] |  +- log4j:log4j:jar:1.2.17:provided
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.25:provided
[INFO] |  +- org.slf4j:jul-to-slf4j:jar:1.7.25:provided
[INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.7.25:provided
[INFO] |  +- commons-lang:commons-lang:jar:2.6:provided
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.7:provided
[INFO] |  +- commons-io:commons-io:jar:2.6:provided
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.9.3:provided
[INFO] |  +- commons-fileupload:commons-fileupload:jar:1.3.2:provided
[INFO] |  +- commons-collections:commons-collections:jar:3.2.2:provided
[INFO] |  +- org.apache.commons:commons-collections4:jar:4.1:provided
[INFO] |  +- net.sf.supercsv:super-csv:jar:2.1.0:provided
[INFO] |  +- commons-validator:commons-validator:jar:1.5.1:provided
[INFO] |  +- hibernate:hibernate:jar:2.1.8-atlassian-34:provided
[INFO] |  +- org.hibernate:hibernate-core:jar:5.2.8.Final:provided
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:provided
[INFO] |  |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:provided
[INFO] |  |  +- org.javassist:javassist:jar:3.20.0-GA:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:provided
[INFO] |  |  +- org.jboss:jandex:jar:2.0.3.Final:provided
[INFO] |  |  +- com.fasterxml:classmate:jar:1.3.0:provided
[INFO] |  |  \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:provided
[INFO] |  +- org.hibernate:hibernate-c3p0:jar:5.2.8.Final:provided
[INFO] |  +- com.atlassian.hibernate:hibernate.adapter:jar:0.101:provided
[INFO] |  |  +- org.hibernate:hibernate-envers:jar:5.2.2.Final:provided
[INFO] |  |  \- org.jboss.logging:jboss-logging-annotations:jar:2.0.0.Final:provided
[INFO] |  +- cglib:cglib:jar:2.1_3:provided
[INFO] |  |  \- asm:asm:jar:1.5.3:provided
[INFO] |  +- dom4j:dom4j:jar:1.6.1:provided
[INFO] |  +- jaxen:jaxen:jar:1.0-FCS:provided
[INFO] |  +- saxpath:saxpath:jar:1.0-FCS:provided
[INFO] |  +- odmg:odmg:jar:3.0:provided
[INFO] |  +- com.mchange:c3p0:jar:0.9.5.1:provided
[INFO] |  |  \- com.mchange:mchange-commons-java:jar:0.2.10:provided
[INFO] |  +- javax.transaction:javax.transaction-api:jar:1.2:provided
[INFO] |  +- com.sun:jai_core:jar:1.1.3:provided
[INFO] |  +- com.sun:jai_codec:jar:1.1.3:provided
[INFO] |  +- opensymphony:webwork:jar:2.1.5-atlassian-3:provided
[INFO] |  +- opensymphony:xwork:jar:1.0.3.6:provided
[INFO] |  +- ognl:ognl:jar:2.6.5-atlassian-3:provided
[INFO] |  +- opensymphony:oscore:jar:2.2.7-atlassian-1:provided
[INFO] |  +- oscache:oscache:jar:2.2:provided
[INFO] |  +- osuser:osuser:jar:atl.user:provided
[INFO] |  +- opensymphony:propertyset:jar:1.3-21Nov03:provided
[INFO] |  +- org.apache.velocity:velocity:jar:1.6.4-atlassian-9:provided
[INFO] |  +- com.atlassian.soy:soy-template-renderer-api:jar:4.5.0:provided
[INFO] |  +- com.atlassian.soy:soy-template-renderer-plugin-api:jar:4.5.0:provided
[INFO] |  +- commons-pool:commons-pool:jar:1.6:provided
[INFO] |  +- javax.mail:mail:jar:1.4.5:provided
[INFO] |  +- com.atlassian.spring:spring-quartz1:jar:0.0.1:provided
[INFO] |  |  +- org.mockito:mockito-core:jar:1.10.8:provided
[INFO] |  |  |  \- org.objenesis:objenesis:jar:2.1:provided
[INFO] |  |  \- org.hamcrest:hamcrest-library:jar:1.3:provided
[INFO] |  +- org.aspectj:aspectjweaver:jar:1.8.10:provided
[INFO] |  +- opensymphony:sitemesh:jar:2.5-atlassian-6:provided
[INFO] |  +- velocity-tools:velocity-tools:jar:view-1.1:provided
[INFO] |  +- radeox:radeox:jar:1.0b2-forked-22Apr2004:provided
[INFO] |  +- org.apache.lucene:lucene-core:jar:4.4.0-atlassian-02:provided
[INFO] |  +- org.apache.lucene:lucene-analyzers-common:jar:4.4.0-atlassian-02:provided
[INFO] |  +- org.apache.lucene:lucene-analyzers-kuromoji:jar:4.4.0-atlassian-02:provided
[INFO] |  +- org.apache.lucene:lucene-misc:jar:4.4.0-atlassian-02:provided
[INFO] |  +- org.apache.lucene:lucene-highlighter:jar:4.4.0-atlassian-02:provided
[INFO] |  |  +- org.apache.lucene:lucene-memory:jar:4.4.0-atlassian-02:provided
[INFO] |  |  \- org.apache.lucene:lucene-queries:jar:4.4.0-atlassian-02:provided
[INFO] |  +- org.apache.lucene:lucene-queryparser:jar:4.4.0-atlassian-02:provided
[INFO] |  |  \- org.apache.lucene:lucene-sandbox:jar:4.4.0-atlassian-02:provided
[INFO] |  |     \- jakarta-regexp:jakarta-regexp:jar:1.4:provided
[INFO] |  +- org.apache.pdfbox:xmpbox:jar:2.0.6:provided
[INFO] |  +- commons-digester:commons-digester:jar:1.5:provided
[INFO] |  +- org.hibernate:jtidy:jar:r8-20060801:provided
[INFO] |  +- org.quartz-scheduler:quartz:jar:1.8.6:provided
[INFO] |  +- com.atlassian.scheduler:atlassian-scheduler-api:jar:1.7.0:provided
[INFO] |  +- com.atlassian.scheduler:atlassian-scheduler-core:jar:1.7.0:provided
[INFO] |  +- com.atlassian.scheduler.caesium:atlassian-scheduler-caesium:jar:1.3.5:provided
[INFO] |  +- org.hsqldb:hsqldb:jar:2.3.0:provided
[INFO] |  +- com.h2database:h2:jar:1.3.176:provided
[INFO] |  +- com.atlassian.hsqldb:atlassian-hsqdlb-server-integration:jar:1.1.0:provided
[INFO] |  +- com.atlassian.h2:atlassian-h2-server-integration:jar:1.0.0:provided
[INFO] |  +- org.postgresql:postgresql:jar:42.1.1:provided
[INFO] |  +- com.microsoft.sqlserver:mssql-jdbc:jar:6.3.0.jre8-preview:provided
[INFO] |  +- net.sourceforge.jtds:jtds:jar:1.3.1:provided
[INFO] |  +- rome:rome:jar:1.0:provided
[INFO] |  +- org.jdom:jdom:jar:1.1.3:provided
[INFO] |  +- commons-jrcs:commons-jrcs:jar:diff-0.1.7:provided
[INFO] |  +- commons-httpclient:commons-httpclient:jar:3.1-atlassian-2:provided
[INFO] |  +- xerces:xercesImpl:jar:2.11.0-atlassian-01:provided
[INFO] |  +- xmlrpc:xmlrpc:jar:2.0+xmlrpc61.1+sbfix:provided
[INFO] |  +- com.atlassian.xmlrpc:xmlrpc-supplementary-character-support:jar:0.2:provided
[INFO] |  +- commons-discovery:commons-discovery:jar:0.5:provided
[INFO] |  +- commons-codec:commons-codec:jar:1.11:provided
[INFO] |  +- oro:oro:jar:2.0.8:provided
[INFO] |  +- com.thoughtworks.xstream:xstream:jar:1.1.1:provided
[INFO] |  |  \- xpp3:xpp3_min:jar:1.1.3.4.O:provided
[INFO] |  +- xalan:xalan:jar:2.7.2:provided
[INFO] |  |  \- xalan:serializer:jar:2.7.2:provided
[INFO] |  +- org.codehaus.woodstox:wstx-asl:jar:3.2.9-atlassian-1:provided
[INFO] |  +- com.octo.captcha:jcaptcha-all:jar:1.0-RC6:provided
[INFO] |  |  \- concurrent:concurrent:jar:1.3.4:provided
[INFO] |  +- org.tuckey:urlrewritefilter:jar:4.0.4:provided
[INFO] |  +- wsdl4j:wsdl4j:jar:1.6.1:provided
[INFO] |  +- com.google.code.findbugs:jsr305:jar:3.0.1:provided
[INFO] |  +- net.jcip:jcip-annotations:jar:1.0:provided
[INFO] |  +- com.atlassian.vcache:atlassian-vcache-api:jar:1.9.4:provided
[INFO] |  |  \- com.atlassian.marshalling:atlassian-marshalling-api:jar:1.0.0:provided
[INFO] |  +- io.atlassian.util.vcache:atlassian-util-vcache:jar:1.0.0:provided
[INFO] |  +- com.atlassian.vcache:atlassian-vcache-internal-legacy:jar:1.9.4:provided
[INFO] |  |  \- com.atlassian.vcache:atlassian-vcache-internal-core:jar:1.9.4:provided
[INFO] |  |     \- com.atlassian.vcache:atlassian-vcache-internal-api:jar:1.9.4:provided
[INFO] |  +- com.atlassian.marshalling:atlassian-marshalling-gson:jar:3.0.1:provided
[INFO] |  +- com.atlassian.marshalling:atlassian-marshalling-jdk:jar:1.1.0:provided
[INFO] |  +- com.atlassian.marshalling:atlassian-marshalling-protobuf:jar:1.0.0:provided
[INFO] |  +- com.atlassian.cache:atlassian-cache-api:jar:2.11.4-21c8259:provided
[INFO] |  +- com.atlassian.cache:atlassian-cache-memory:jar:2.11.4-21c8259:provided
[INFO] |  |  \- com.atlassian.cache:atlassian-cache-common-impl:jar:2.11.4-21c8259:provided
[INFO] |  +- com.atlassian.beehive:beehive-api:jar:0.2.1:provided
[INFO] |  +- com.atlassian.sal:sal-spi:jar:3.1.0:provided
[INFO] |  +- com.atlassian.sal:sal-spring:jar:3.1.0:provided
[INFO] |  +- com.atlassian.sal:sal-api:jar:3.1.0:provided
[INFO] |  +- com.atlassian.sal:sal-trust-api:jar:3.1.0:provided
[INFO] |  +- com.atlassian.confluence:confluence-java-api:jar:6.6.0:provided
[INFO] |  +- com.atlassian.confluence:confluence-rest-api:jar:6.6.0:provided
[INFO] |  |  \- javax.ws.rs:jsr311-api:jar:1.1.1:provided
[INFO] |  +- com.atlassian.confluence:confluence-rest-serialization:jar:6.6.0:provided
[INFO] |  +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13-atlassian-1:provided
[INFO] |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13-atlassian-1:provided
[INFO] |  +- com.atlassian.activeobjects:activeobjects-dbex:jar:1.2.3:provided
[INFO] |  |  \- com.atlassian.activeobjects:activeobjects-spi:jar:1.2.3:provided
[INFO] |  +- org.owasp.antisamy:antisamy:jar:1.5.3-atlassian-2:provided
[INFO] |  +- org.apache.xmlgraphics:batik-css:jar:1.9:provided
[INFO] |  |  +- org.apache.xmlgraphics:batik-util:jar:1.9:provided
[INFO] |  |  |  +- org.apache.xmlgraphics:batik-constants:jar:1.9:provided
[INFO] |  |  |  \- org.apache.xmlgraphics:batik-i18n:jar:1.9:provided
[INFO] |  |  +- org.apache.xmlgraphics:xmlgraphics-commons:jar:2.2:provided
[INFO] |  |  \- xml-apis:xml-apis-ext:jar:1.3.04:provided
[INFO] |  +- org.apache.xmlgraphics:batik-ext:jar:1.9:provided
[INFO] |  +- org.outerj.daisy:daisydiff:jar:1.1-atlassian-5:provided
[INFO] |  |  \- org.eclipse.core:runtime:jar:20070801:provided
[INFO] |  +- com.atlassian.velocity.htmlsafe:velocity-htmlsafe:jar:1.5.1:provided
[INFO] |  +- com.atlassian.botocss:botocss-core:jar:6.3:provided
[INFO] |  |  +- org.jsoup:jsoup:jar:1.8.3:provided
[INFO] |  |  \- net.sf.cssbox:jstyleparser:jar:1.16-atlassian-1:provided
[INFO] |  +- com.google.guava:guava:jar:18.0:provided
[INFO] |  +- com.atlassian.fugue:fugue:jar:2.7.0:provided
[INFO] |  +- io.atlassian.fugue:fugue:jar:4.5.0:provided
[INFO] |  +- io.atlassian.fugue:fugue-deprecated:jar:4.5.0:provided
[INFO] |  +- io.atlassian.fugue:fugue-guava:jar:4.5.0:provided
[INFO] |  +- io.atlassian.fugue:fugue-optics:jar:4.5.0:provided
[INFO] |  +- io.atlassian.fugue:fugue-retry:jar:4.5.0:provided
[INFO] |  +- com.atlassian.http:atlassian-http:jar:1.1.7:provided
[INFO] |  +- com.atlassian.instrumentation:atlassian-instrumentation-core:jar:2.2.2:provided
[INFO] |  +- com.github.kristofa:brave-web-servlet-filter:jar:3.0.0:provided
[INFO] |  |  \- com.github.kristofa:brave-http:jar:3.0.0:provided
[INFO] |  |     \- com.github.kristofa:brave-core:jar:3.0.0:provided
[INFO] |  |        \- org.apache.thrift:libthrift:jar:0.9.0:provided
[INFO] |  +- com.github.kristofa:brave-apache-http-interceptors:jar:3.0.0:provided
[INFO] |  +- io.atlassian.zipkin:atlassian-brave-spancollector-core:jar:1.0.0:provided
[INFO] |  +- com.atlassian.tenancy:atlassian-tenancy-api:jar:2.0.0:provided
[INFO] |  +- com.atlassian.ozymandias:atlassian-plugin-point-safety:jar:0.14:provided
[INFO] |  +- org.elasticsearch:elasticsearch:jar:2.0.1-atlassian-shaded-1:provided
[INFO] |  +- com.github.gquintana.metrics:metrics-sql:jar:3.1.0-atlassian-4:provided
[INFO] |  +- com.atlassian.confluence:confluence-extractor-api:jar:1.1.2:provided
[INFO] |  \- com.atlassian.plugins:atlassian-whitelist-api-plugin:jar:3.0.2:provided
[INFO] +- com.atlassian.plugin:atlassian-spring-scanner-annotation:jar:1.2.13:compile
[INFO] +- com.atlassian.plugin:atlassian-spring-scanner-runtime:jar:1.2.13:runtime
[INFO] +- javax.inject:javax.inject:jar:1:provided
[INFO] +- com.atlassian.plugins:atlassian-plugins-osgi-testrunner:jar:1.2.3:test
[INFO] |  +- org.apache.wink:wink-client:jar:1.1.3-incubating:test
[INFO] |  |  +- org.apache.wink:wink-common:jar:1.1.3-incubating:test
[INFO] |  |  |  \- org.apache.geronimo.specs:geronimo-annotation_1.1_spec:jar:1.0:test
[INFO] |  |  \- com.sun.xml.bind:jaxb-impl:jar:2.2.1.1:provided
[INFO] |  \- com.atlassian.upm:upm-api:jar:2.15:test
[INFO] +- com.google.code.gson:gson:jar:2.2.2-atlassian-1:compile
[INFO] +- com.atlassian.plugins.rest:atlassian-rest-common:jar:2.8.0-confluence3:provided
[INFO] |  +- com.atlassian.plugins.rest:com.atlassian.jersey-library:pom:2.8.0-confluence3:provided
[INFO] |  |  +- com.sun.jersey:jersey-server:jar:1.8-atlassian-8:provided
[INFO] |  |  +- com.sun.jersey:jersey-json:jar:1.8-atlassian-8:provided
[INFO] |  |  |  \- org.codehaus.jettison:jettison:jar:1.1:provided
[INFO] |  |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.1:provided
[INFO] |  |  \- org.codehaus.jackson:jackson-xc:jar:1.9.1:provided
[INFO] |  +- com.sun.jersey:jersey-core:jar:1.8-atlassian-8:provided
[INFO] |  +- javax.xml.bind:jaxb-api:jar:2.1:provided
[INFO] |  |  \- javax.xml.stream:stax-api:jar:1.0-2:provided
[INFO] |  \- org.hibernate:hibernate-validator:jar:4.0.2.GA:provided
[INFO] |     \- javax.validation:validation-api:jar:1.0.0.GA:provided
[INFO] +- javax.ws.rs:javax.ws.rs-api:jar:2.1:compile
[INFO] +- org.apache.cxf:cxf-rt-rs-client:jar:3.2.1:runtime
[INFO] |  +- org.apache.cxf:cxf-rt-transports-http:jar:3.2.1:runtime
[INFO] |  +- org.apache.cxf:cxf-core:jar:3.2.1:runtime
[INFO] |  |  +- com.fasterxml.woodstox:woodstox-core:jar:5.0.3:runtime
[INFO] |  |  |  \- org.codehaus.woodstox:stax2-api:jar:3.1.4:runtime
[INFO] |  |  \- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.2:runtime
[INFO] |  \- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:3.2.1:runtime
[INFO] |     \- javax.annotation:javax.annotation-api:jar:1.3:compile
[INFO] +- com.sun.xml.bind:jaxb1-impl:jar:2.0.2:runtime
[INFO] +- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.13:runtime
[INFO] +- javax.cache:cache-api:jar:1.1.0:runtime
[INFO] +- javax.enterprise:cdi-api:jar:2.0:runtime
[INFO] |  +- javax.el:javax.el-api:jar:3.0.0:runtime
[INFO] |  \- javax.interceptor:javax.interceptor-api:jar:1.2:runtime
[INFO] +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.26-b03:runtime   <---
[INFO] +- org.glassfish.jersey.bundles.repackaged:jersey-jsr166e:jar:2.26-b02:runtime <---
[INFO] +- org.glassfish.jersey.core:jersey-client:jar:2.25:runtime
[INFO] |  +- org.glassfish.jersey.core:jersey-common:jar:2.25:compile
[INFO] |  |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] |  +- org.glassfish.hk2:hk2-api:jar:2.5.0-b30:compile
[INFO] |  |  +- org.glassfish.hk2:hk2-utils:jar:2.5.0-b30:compile
[INFO] |  |  \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b30:compile
[INFO] |  +- org.glassfish.hk2.external:javax.inject:jar:2.5.0-b30:compile
[INFO] |  \- org.glassfish.hk2:hk2-locator:jar:2.5.0-b30:compile
[INFO] \- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.25:compile
[INFO]    +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.25:compile
[INFO]    +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.8.4:compile
[INFO]    |  +- com.fasterxml.jackson.core:jackson-core:jar:2.8.4:compile
[INFO]    |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.8.4:compile
[INFO]    +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.8.4:compile
[INFO]    |  \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.8.4:compile
[INFO]    \- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.4:compile
1 Like

Hi @david3,

Based on the dependency tree you’ve added, I’ve seen a number of dependencies that use runtime as scope. Is there a specific reason for this? Kindly share the POM file too, it will come in very handy when trying to replicate the issue.

Cheers,
Ian

3 Likes

Thanks for the quick response! Yea, the large amount of runtime is me trying to debug the problem and throwing in everything. Things compile fine in my IDE and using atlas-mvn package but when deployed to my local Confluence instance using atlas-run I get that OSGi error. So I was thinking it was a runtime dependency issue hence me throwing the kitchen sink in. :slight_smile:

This all stemmed from needing javax.ws.rs-api and cxf-rt-rs-client, as I need to be able to make RESTful calls from my plugin, and then the dependencies you see in the POM after are me tacking them on to eliminate the OSGi errors until I hit the one I can’t get passed. Maybe I am not going at this the right way.

Here is the pom…

<?xml version="1.0" encoding="UTF-8"?>
<project 
    xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.my.confluence</groupId>
    <artifactId>MyPlugin</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <organization>
        <name>Corp</name>
        <url>http://www.company.com</url>
    </organization>
    <name>MyPlugin</name>
    <description>This is the plugin for Atlassian Confluence.</description>
    <packaging>atlassian-plugin</packaging>
    <properties>
        <confluence.version>6.6.0</confluence.version>
        <confluence.data.version>6.6.0</confluence.data.version>
        <amps.version>6.3.13</amps.version>
        <plugin.testrunner.version>1.2.3</plugin.testrunner.version>
        <atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
        <!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <!-- WS / Rest -->
        <jackson.version>1.9.8</jackson.version>
        <glassfish.jersey.version>2.25</glassfish.jersey.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <version>${atlassian.spring.scanner.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-runtime</artifactId>
            <version>${atlassian.spring.scanner.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
            <scope>provided</scope>
        </dependency>
        <!-- WIRED TEST RUNNER DEPENDENCIES -->
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
            <version>${plugin.testrunner.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.2-atlassian-1</version>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <version>2.8.0-confluence3</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-client</artifactId>
            <version>3.2.1</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb1-impl</artifactId>
            <version>2.0.2</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.fastinfoset</groupId>
            <artifactId>FastInfoset</artifactId>
            <version>1.2.13</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>javax.cache</groupId>
            <artifactId>cache-api</artifactId>
            <version>1.1.0</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.bundles.repackaged</groupId>
            <artifactId>jersey-guava</artifactId>
            <version>2.26-b03</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.bundles.repackaged</groupId>
            <artifactId>jersey-jsr166e</artifactId>
            <version>2.26-b02</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>${glassfish.jersey.version}</version>
             <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
            <version>${glassfish.jersey.version}</version>
             <scope>compile</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>atlassian</id>
            <name>Atlassian Repository</name>
            <url>https://maven.atlassian.com/content/groups/public/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>atlassian-public</id>
            <url>https://m2proxy.atlassian.com/repository/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-confluence-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${confluence.version}</productVersion>
                    <productDataVersion>${confluence.data.version}</productDataVersion>
                    <enableQuickReload>true</enableQuickReload>
                    <enableFastdev>false</enableFastdev>
                    <!-- See here for an explanation of default instructions: -->
                    <!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
                    <instructions>
                        <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
                        <!-- Add package to export here -->
                        <Export-Package>                            com.my.confluence.myplugin.api,                        </Export-Package>
                        <!-- Add package import here -->
                        <Import-Package>                            org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional",                            *                        </Import-Package>
                        <!-- Ensure plugin is spring powered -->
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
                <version>${atlassian.spring.scanner.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>atlassian-spring-scanner</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                </executions>
                <configuration>
                    <scannedDependencies>
                        <dependency>
                            <groupId>com.atlassian.plugin</groupId>
                            <artifactId>atlassian-spring-scanner-external-jar</artifactId>
                        </dependency>
                    </scannedDependencies>
                    <verbose>false</verbose>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

This is interesting, @dhergert. I cannot replicate the issue as of yet, so I cannot pinpoint if this is a dependency problem or an Import-Package one.

Kindly create a Support Request in go.atlassian.com/devhelp, and attach your project there so I can try and replicate it on my local machine. If you have a stripped-down version of that project wherein this error manifests, that’s perfect.

Cheers,
Ian

1 Like

The OSGi system is importing all of the osgi packages it can find when it starts.
This line:

&lt;Import-Package&gt;                            org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional",                            *

Change it to:

                        <Import-Package>                            org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional"

(make everything be optional).

After that the plugin system should only be complaining about the services that you’re importing and it’s requirements.

1 Like

Hey @iragudo, I will absolutely submit it if I can’t get through this last step. It’s a pretty simple plugin, I was just trying to get an Admin interface, populate bandana and a macro.

@daniel - I did as you suggested and now I get a different error.

[atlassian.confluence.plugin.PluginFrameworkContextListener] contextInitialized Error initialising plugin manager: The plugin key 'com.my.confluence.MyPlugin' must either match the OSGi bundle symbolic name (Bundle-SymbolicName) or be specified in the Atlassian-Plugin-Key manifest header
java.lang.IllegalArgumentException: The plugin key 'com.my.confluence.MyPlugin' must either match the OSGi bundle symbolic name (Bundle-SymbolicName) or be specified in the Atlassian-Plugin-Key manifest header
at com.atlassian.plugin.osgi.factory.OsgiPluginUninstalledHelper.install(OsgiPluginUninstalledHelper.java:47)
at com.atlassian.plugin.osgi.factory.OsgiPlugin.installInternal(OsgiPlugin.java:367)
at com.atlassian.plugin.impl.AbstractPlugin.install(AbstractPlugin.java:424)

Oooh. That’s a new one. Can you lowercase your maven groupId and artifactId in the Pom? You’ll probably need to do atlas-clean as well.

1 Like

Hi! Your last error indicates that there is a mismatch between the <atlassian.plugin.key> set in maven-amps-plugin (or maven-jira/confluence-plugin) and the atlassian.plugin.key set in atlassian-plugin.xml.

When working correctly, you should be able to inspect the plugin in an OSGi broswer and see that the Bundle-SymbolicName and AtlassianPluginKey are equal. This should also be visible in the MANIFEST.MF file of the built plugin.

In Jira the OSGi browser is accessible at http:///plugins/servlet/upm/osgi