Can I use Spring Scanner 2 with AtlassianPluginsTestRunner?

In our Team we develop Jira Plugins for our companies Jira server.
We explored using OSGi to share Components between two Plugins. For that we have to use the Atlassian Scanner 2, specified in the plugin-context.xml file.
The plugin-context.xml is the same as from https://bitbucket.org/atlassian/atlassian-spring-scanner/src/master/
That is:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:atlassian-scanner="http://www.atlassian.com/schema/atlassian-scanner/2"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.atlassian.com/schema/atlassian-scanner/2
        http://www.atlassian.com/schema/atlassian-scanner/2/atlassian-scanner.xsd">
    <atlassian-scanner:scan-indexes/>
</beans>

Unfortunately the WiredTest generated by the Atlassian SDK does not work, after I changed the plugin-context.xml and pom.xml to use Spring Scanner 2. The Wired test worked just fine before the switch, the other parts of the plugin do not get broken by switching to Scanner 2.

I get the surefire Error:
java.lang.Throwable: unable to find runner for class: it.comatlasrunner.MyComponentWiredTest

The relevant part of the WiredTest is:

import com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner;
@RunWith(AtlassianPluginsTestRunner.class)
public class MyComponentWiredTest
{

Is there a solution for this problem?
Thank you very much for your help

Are you trying to run atlas-integration-test? Last time I looked into it, integration tests were a mess in the 8.0.16 SDK.

I do have 2 plugins that share services (one of the plugins even has a scannedDependency library).
All of our unit tests work fine with @RunWith(MockitoJUnitRunner.class).
Our single integration test class, last I knew, worked with @WebTest({Category.ADMINISTRATION, Category.REST}) - it’s testing a REST API endpoint.


A few things to check:

  1. dependency on test scope
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
            <version>${plugin.testrunner.version}</version>
            <scope>test</scope>
        </dependency>
  1. build > jira-maven-plugin > configuration has the dependencies
                    <pluginArtifacts>
                        <pluginArtifact>
                            <groupId>com.atlassian.jira</groupId>
                            <artifactId>jira-func-test-plugin</artifactId>
                            <version>${jira.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.jira.tests</groupId>
                            <artifactId>jira-testkit-plugin</artifactId>
                            <version>${testkit.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>

Thanks for the reply, sorry for the late reply.

I tried my atlas-integration-test with your PluginArtifacts but it still didn’t work.

We will look into it when we eventually have to use and solve it.

I will post here in that case.