Import components from confluence.mobile.plugin

Hello,

We are trying to setup custom mobile push notifications for Confluence.
We tried to include components from com.atlassian.confluence.plugins.mobile.
Here is how pom.xml looks:

<?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.atlassian.confluence.get.CustomNotification</groupId>
    <artifactId>CustomNotification</artifactId>
    <version>1.0.0-SNAPSHOT</version>

    <organization>
        <name>Example Company</name>
        <url>http://www.example.com/</url>
    </organization>

    <name>CustomNotification</name>
    <description>This is the com.atlassian.confluence.get.CustomNotification:CustomNotification plugin for Atlassian Confluence.</description>
    <packaging>atlassian-plugin</packaging>
	
    <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>
            <exclusions>
                <exclusion>
                    <groupId>com.atlassion.gzipfilter</groupId>
                    <artifactId>atlassian-gzipfilter</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        
		<dependency>
		  <groupId>com.atlassian.mywork</groupId>
		  <artifactId>mywork-api</artifactId>
		  <version>6.2.4</version>
		  <scope>provided</scope>
		</dependency>
		
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-javaconfig</artifactId>
            <version>${osgi.javaconfig.version}</version>
        </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.activeobjects</groupId>
          <artifactId>activeobjects-plugin</artifactId>
          <version>0.19.7</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>
 		

		
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.2-atlassian-1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
            <version>${plugin.testrunner.version}</version>
            <scope>test</scope>
        </dependency>
               
        <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
    <scope>provided</scope>
</dependency>

<dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-java-api</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
        </dependency>
        
        <dependency>
            <groupId>com.atlassian.httpclient</groupId>
            <artifactId>atlassian-httpclient-api</artifactId>
            <version>0.20.1</version>
            <scope>provided</scope>
        </dependency>
		<dependency>
    <groupId>com.atlassian.plugin</groupId>
    <artifactId>atlassian-spring-scanner-annotation</artifactId>
    <version>2.2.0</version>
    <scope>provided</scope>
</dependency>
		
		<dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-rest-resources</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <version>6.1.6</version>
            <scope>provided</scope>
        </dependency>
        <!-- OSGi Java Config dependencies -->
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.framework</artifactId>
            <version>4.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
            <scope>provided</scope>
        </dependency>
 <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>${spring.version}</version>
    <scope>provided</scope>
</dependency>

<!-- 
<dependency>
    <groupId>com.atlassian.confluence.plugins</groupId>
    <artifactId>confluence-collaborative-editor-plugin</artifactId>
    <version>6.1.4</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>com.atlassian.confluence.plugins</groupId>
    <artifactId>recently-viewed-plugin</artifactId>
    <version>17.10.3</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>com.atlassian.confluence.plugins</groupId>
    <artifactId>confluence-inline-tasks</artifactId>
    <version>13.3.2</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>com.atlassian.confluence.plugins</groupId>
    <artifactId>confluence-mentions-plugin</artifactId>
    <version>1.9.13</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>com.atlassian.confluence.plugins</groupId>
    <artifactId>share-page</artifactId>
    <version>3.1</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.sun.net.httpserver</groupId>
    <artifactId>http</artifactId>
    <version>20070405</version>
</dependency>
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-core</artifactId>
    <version>2.3.0</version>
</dependency>


<dependency>
    <groupId>com.atlassian.plugins.rest</groupId>
    <artifactId>com.atlassian.jersey-library</artifactId>
    <version>3.0.12</version>
    <type>pom</type>
</dependency>


     

 -->
  		
 		
    <dependency>
			<groupId>com.atlassian.confluence.plugins</groupId>
			<artifactId>confluence-mobile-plugin</artifactId>
			<version>2.2.4</version>
			
		</dependency>
		
    </dependencies>
    
  
   <build>
        <plugins>

            <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>
                    <!-- Enable this to get build-time logging of annotations atlassian-spring-scanner-maven-plugin has noticed -->
                    <verbose>false</verbose>
                    
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>confluence-maven-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>
                        
						<Spring-Context>*</Spring-Context>
                        <!-- Add package to export here -->
                        <Export-Package>
                            com.atlassian.confluence.getCustomNotification.*,
                        </Export-Package>

                        <!-- Add package import here   -->
                        
                        <Import-Package>
							com.atlassian.confluence.event.events.content,
							com.atlassian.confluence.event.events.content.page,
							com.atlassian.event,
							com.atlassian.confluence.user,
							com.atlassian.user,
							com.atlassian.confluence.plugins.mobile.*;resolution:="optional",
							org.springframework.osgi.*;resolution:="optional",
							org.eclipse.gemini.blueprint.*;resolution:="optional",
                            
                            com.atlassian.confluence.rest.serialization,
                            com.atlassian.confluence.content.render.xhtml.storage,
                            com.atlassian.confluence.content.render.xhtml.transformers,
                            com.atlassian.confluence.content.render.xhtml.macro,
                            com.atlassian.confluence.content.render.xhtml.view.macro,
                            com.atlassian.confluence.languages,
                            com.atlassian.confluence.content.render.xhtml,
                            com.atlassian.confluence.content.render.xhtml.compatibility,
                            *
                        </Import-Package>

                        
                        
                    </instructions>
                </configuration>
            </plugin>
            
        </plugins>
    </build>

    <properties>
       <ao.version>0.29.3</ao.version>
        <confluence.version>6.14.0</confluence.version>
        <confluence.data.version>6.14.0</confluence.data.version>
        <amps.version>8.1.0</amps.version>
        <osgi.javaconfig.version>0.2.0</osgi.javaconfig.version>
        <spring.version>4.2.5.RELEASE</spring.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>
    </properties>

</project>

For now, we didn’t include com.atlassian.confluence.plugins.mobile.service.PushNotificationService, however, without that, we are still getting next error during plugin installation:

 ERROR [ThreadPoolAsyncTaskExecutor::Thread 207] [internal.dependencies.startup.DependencyWaiterApplicationContextExecutor] fail Unable to create application context for [com.atlassian.confluence.get.CustomNotification], unsatisfied dependencies: none
 -- url: /rest/plugins/1.0/ | referer: https://localhost:1990/confluence/plugins/servlet/upm/manage/all | traceId: d1068fd8855cc063 | userName: JelRadovanovic
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pushNotificationServiceImpl': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pushNotificationClient': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pushNotificationHelper': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.config.ApplicationConfiguration' available: expected single matching bean but found 2: applicationConfig,applicationConfiguration
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1198)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1100)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
        at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:57)
        at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:322)
        at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
        at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:287)
        at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pushNotificationClient': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pushNotificationHelper': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.config.ApplicationConfiguration' available: expected single matching bean but found 2: applicationConfig,applicationConfiguration
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1198)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1100)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1136)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064)
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
        ... 19 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pushNotificationHelper': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.config.ApplicationConfiguration' available: expected single matching bean but found 2: applicationConfig,applicationConfiguration
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1198)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1100)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1136)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064)
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
        ... 33 more
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.atlassian.config.ApplicationConfiguration' available: expected single matching bean but found 2: applicationConfig,applicationConfiguration
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveNotUnique(DependencyDescriptor.java:173)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1114)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064)
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
        ... 47 more

Does anybody knows how this could be fixed?