Confluence-Maven-Plugin Error

I am currently developing a plugin for confluence 7.13.7 and using the Atlassian SDK 8.2.7. When I imported the plugin skeleton generated using the atlas-create-confluence-plugin into my IntelliJ IDE, I got the following error:

Unresolveable build extension: Plugin com.atlassian.maven.plugins:confluence-maven-plugin:8.1.2 or one of its dependencies could not be resolved: com.atlassian.maven.plugins:confluence-maven-plugin:jar:8.1.2 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced

Below is my pom.xml file:

<?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.grazitti.confluence</groupId>
    <artifactId>plugin</artifactId>
    <version>1.0.0-SNAPSHOT</version>

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

    <name>plugin</name>
    <description>This is the com.grazitti.confluence:plugin plugin for Atlassian Confluence.</description>
<!--    <packaging>atlassian-plugin</packaging>-->

    <repositories>
        <repository>
            <id>custom-2</id>
            <name>Central Repository custom-2</name>
            <url>https://packages.atlassian.com/maven-public/com/atlassian/confluence/</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>custom-3</id>
            <name>Central Repository custom-3</name>
            <url>https://packages.atlassian.com/content/repositories/atlassian-public/</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>custom-1</id>
            <name>Central Repository custom-1</name>
            <url>https://packages.atlassian.com/mvn/maven-atlassian-external/</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>custom-19</id>
            <name>Central Repository custom-19</name>
            <url>https://repo.spring.io/ui/native/plugins-release</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>custom-5</id>
            <name>Central Repository custom-5</name>
            <url>https://packages.atlassian.com/maven-public/com/atlassian/maven/plugins/</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>custom-37</id>
            <name>Central Repository custom-37</name>
            <url>https://repo.spring.io/ui/native/plugins-release/com/atlassian/plugin/atlassian-spring-scanner-maven-plugin/2.1.7/atlassian-spring-scanner-maven-plugin-2.1.7.jar</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>confluence-maven-plugin</artifactId>
            <version>8.1.2</version>
        </dependency>
        <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-maven-plugin</artifactId>
            <version>2.1.7</version>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <version>${atlassian.spring.scanner.version}</version>
            <scope>provided</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>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>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <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>

                    <!-- 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.grazitti.confluence.plugin.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>
                    <verbose>false</verbose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <properties>
        <confluence.version>7.13.7</confluence.version>
        <confluence.data.version>7.13.7</confluence.data.version>
        <amps.version>8.1.2</amps.version>
        <plugin.testrunner.version>2.0.2</plugin.testrunner.version>
        <atlassian.spring.scanner.version>2.1.7</atlassian.spring.scanner.version>
        <!-- This property ensures consistency between the key in atlassian-plugin.xml and the OSGi bundle's key. -->
        <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>

What error, you only posted your pom.xml.

I am really sorry, I have updated my question.

I think you need to change the primary repository from Maven Central to the one in Atlassian Plugin SDK. Those Jira packages aren’t published in Maven Central, and are available in the Plugin SDK only.

I don’t use IntelliJ myself though, I only use Eclipse, so I can’t give you the exact steps to change it.

For Eclipse, the repository used is configured in workspace settings, so I have to create a new workspace for Jira plugins.

The Plugin SDK maven config file is by default here:
C:\Applications\Atlassian\atlassian-plugin-sdk-8.2.7\apache-maven-3.5.4\conf\settings.xml

@KCWong thank you so much, Actually, I added a repo pointing towards the confluence plugins in the settings.xml and it solved my issue.