How/where to find com.atlassian.plugins:atlassian-spring-scanner-annotation:jar?

Frank May 26, 2021

I am trying to follow the tutorial "Creating an admin configuration form".

I got an error about the classes com.atlassian.plugin.spring.scanner.annotation.component.Scanned and com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport not being found, and found that I presumably need to add another dependency to the pom file.

I tried to add

 <dependency>
  <groupId>com.atlassian.plugins</groupId>
  <artifactId>atlassian-spring-scanner-annotation</artifactId>
  <version>2.2.1</version>
  <scope>provided</scope>
</dependency>

to this file, and also tried different versions. But none of the versions 2.2.2, 2.2.1-8199150, 2.2.1 which I found at the Maven Repository overview for Atlassian Public worked: I got the error

[ERROR] Failed to execute goal on project xproduct-admin-ui-plugin: Could not resolve dependencies for project de.steep.plugins.tutorial:xproduct-admin-ui-plugin:atlassian-plugin:1.0.0-SNAPSHOT: Could not find artifact com.atlassian.plugins:atlassian-spring-scanner-annotation:jar:2.2.1 in atlassian-public (https://maven.atlassian.com/repository/public) -> [Help 1]

for all these versions when running 

atlas-mvn clean package

I tried to look at the URL stated in the error message https://maven.atlassian.com/repository/public, which redirects to https://packages.atlassian.com/maven-external/, but that is a huge directory structure where I could not find anything like atlassian-spring-scanner-annotation.

How can I resolve this issue?

 

1 answer

1 vote
Frank May 26, 2021

I found a solution that seems to work - at least I can compile and deploy.

According to atlassian / atlassian-spring-scanner — Bitbucket, I changed several things in my pom.xml file:

  • use com.atlassian.plugin:atlassian-spring-scanner-annotation, not, my mis-spelled com.atlassian.plugins:atlassian-spring-scanner-annotation.
  • add another plugin as follows:
<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>
            <!-- process-classes seems to be skipped if you are using scala
                 so perhaps use prepare-package -->
            <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>
  •  Remove @Scanned from the servlet class source code.

After running

atlas-mvn eclipse:eclipse

the errors (but not all warnings) have disappeared in Eclipse now as well.

Hieu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 24, 2022

Hi @Frank 
You can change 

<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>

It's work for me 

Like Someone_Somewhere likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events