BitBucker Server Plugin Creation

Hey everyone,
I just created a project using the atlassian sdk “atlas-create-bitbucket-plugin”. I was getting an error that several of the dependences were missing their versions, so I put in version numbers from : https://mvnrepository.com/ . Now I get this error:

Your project has dependencies that are not resolved locally. Code completion in the IDE will not include classes from these dependencies or their transitive dependencies (unless they are among the open projects).
Please download the dependencies, or install them manually, if not available remotely.

The artifacts are:
com.atlassian.sal:sal-api:jar:3.1.0
com.atlassian.bitbucket.server:bitbucket-api:jar:4.0.0-m27
com.atlassian.bitbucket.server:bitbucket-spi:jar:4.0.0-m27
com.atlassian.bitbucket.server:bitbucket-page-objects:jar:4.0.0-m27
javax.servlet:javax.servlet-api:jar:3.1.0
com.atlassian.plugin:atlassian-spring-scanner-runtime:jar:1.2.13
commons-io:commons-io:jar:1.4

Have I put in wrong versions? Should I go ahead and try to install it locally?

I tried installing all of the dependencies manually like so : mvn install:install-file -Dfile=sal-trust-api-3.1.0.jar -DgroupId=com.atlassian.bitbucket.sal -DartifactId=sal-api -Dversion=3.1.0 -Dpackaging=jar

But still get the same error message

The sdk should give you version that you don’t have to add anything to. Can you paste the pom.xml in here?

How are you triggering maven? atlas-mvn, atlas-package etc?

Clean POM

<?xml version="1.0" encoding="UTF-8"?>
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>com.test</artifactId>
<version>1.0.0</version>

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

<name>com.test</name>
<description>This is the com.test:com.test plugin for Atlassian Bitbucket Server.</description>
<packaging>atlassian-plugin</packaging>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-parent</artifactId>
            <version>${bitbucket.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>com.atlassian.sal</groupId>
        <artifactId>sal-api</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.atlassian.bitbucket.server</groupId>
        <artifactId>bitbucket-api</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.atlassian.bitbucket.server</groupId>
        <artifactId>bitbucket-spi</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.atlassian.bitbucket.server</groupId>
        <artifactId>bitbucket-page-objects</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</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>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>bitbucket-maven-plugin</artifactId>
            <version>${amps.version}</version>
            <extensions>true</extensions>
            <configuration>
                <products>
                    <product>
                        <id>bitbucket</id>
                        <instanceId>bitbucket</instanceId>
                        <version>${bitbucket.version}</version>
                        <dataVersion>${bitbucket.data.version}</dataVersion>
                    </product>  
                </products>
                <instructions>
                    <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>

                    <!-- Add package to export here -->
                    <Export-Package>
                        com.test.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>

<properties>
    <bitbucket.version>4.9.1</bitbucket.version>
    <bitbucket.data.version>4.9.1</bitbucket.data.version>
    <amps.version>6.2.11</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>
</properties>

It looks like Netbeans is using the bundled Maven version which searches: https://repo.maven.apache.org/maven2/ by default. Maybe I should try to change it to look in maven.atlassian.com or https://mvnrepository.com/

That should be working. Did you configure netbeans to use the maven settings.xml that’s included in the sdk?

Do an atlas-version and you should get something like:

ATLAS Version: 6.2.14
ATLAS Home: /Applications/Atlassian/atlassian-plugin-sdk-6.1.0
ATLAS Scripts: /Applications/Atlassian/atlassian-plugin-sdk-6.1.0/bin
ATLAS Maven Home: /Applications/Atlassian/atlassian-plugin-sdk-6.1.0/apache-maven-3.2.1
AMPS Version: 6.2.11

You need to use the Maven version specified at ATLAS Maven Home. But more importantly there’s a settings.xml at {ATLAS Maven Home}/conf/settings.xml that you should use. That will cause things to be matched up properly.

Yup that was it! Thank you!