Configure IDEA to use the SDK

plugin-sdk

#1

Hi,

I have followed the instructions posted here:
https://developer.atlassian.com/docs/developer-tools/working-in-an-ide/configure-idea-to-use-the-sdk

However, I am still getting “Cannot resolve symbol” for Jira imports.
IDEA sees JDK just fine, but unable to see Jira’s SDK.

Is there anything else that I will need to configure?


Unable to resolve missing requirement osgi.wiring.package
#2

Even if you use IDEA, call the following in the console:

atlas-mvn eclipse:eclipse

For me, that solved the problem.


#3

Hmm…tried that, no luck. I included a screen capture if that helps.


#4

Yeah that tutorial won’t work…

You need to set up your maven settings:

Step 1

In a terminal - execute atlas-version. 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
--------
Executing: /Applications/Atlassian/atlassian-plugin-sdk-6.1.0/apache-maven-3.2.1/bin/mvn --version -gs /Applications/Atlassian/atlassian-plugin-sdk-6.1.0/apache-maven-3.2.1/conf/settings.xml
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T09:37:52-08:00)
Maven home: /Applications/Atlassian/atlassian-plugin-sdk-6.1.0/apache-maven-3.2.1
Java version: 1.8.0_65, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac"

# Step 2

Note the value of ATLAS Maven Home. In my case it’s /Applications/Atlassian/atlassian-plugin-sdk-6.1.0/apache-maven-3.2.1

Inside this folder is your maven settings file (at conf/settings.xml ).

# Step 3

Head back into IDEA and go to your preferences and under Build, Execution, Deployment > Build Tools > Maven:

Fill out your User settings file with the conf/settings.xml file path (absolute path) and unless you have a very specific need from some other maven version - change the maven home directory as well.


#5

Hi, did just that and still no good.

Step 1

atlas-version

ATLAS Version:    6.2.15
ATLAS Home:       C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.15
ATLAS Scripts:    C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.15\bin
ATLAS Maven Home: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.15\apache-maven-3.2.1
AMPS Version:     6.2.11
--------
Executing: "C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.15\apache-maven-3.2.1\bin\mvn.bat" --version -gs C:\Appli
cations\Atlassian\atlassian-plugin-sdk-6.2.15\apache-maven-3.2.1/conf/settings.xml
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T09:37:52-08:00)
Maven home: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.15\apache-maven-3.2.1
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_121\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"

Step 2/3

Step 4

File -> Invalidate Caches / Restart


#6

Here is my pom.xml

<?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.plugins.tutorial.jira</groupId>
    <artifactId>jira-report-plugin</artifactId>
    <version>1.0-SNAPSHOT</version>
    <organization>
        <name>Atlassian Developers</name>
        <url>https://developer.atlassian.com/</url>
    </organization>
    <name>jira-report-plugin</name>
    <description>Extends JIRA issue reports.</description>
    <packaging>atlassian-plugin</packaging>
    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Add dependency on jira-core if you want access to JIRA implementation classes as well as the sanctioned API.-->
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</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>
        <!-- Uncomment to use TestKit in your project. Details at https://bitbucket.org/atlassian/jira-testkit -->
        <!-- You can read more about TestKit at https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Smarter+integration+testing+with+TestKit -->
        <!--
		<dependency>
			<groupId>com.atlassian.jira.tests</groupId>
			<artifactId>jira-testkit-client</artifactId>
			<version>${testkit.version}</version>
			<scope>test</scope>
		</dependency>
		-->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.8.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <applications>
                        <application>
                            <applicationKey>jira-software</applicationKey>
                            <version>${jira.software.application.version}</version>
                        </application>
                        <application>
                            <applicationKey>jira-servicedesk</applicationKey>
                            <version>${jira.servicedesk.application.version}</version>
                        </application>
                    </applications>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.version}</productDataVersion>
                    <!-- Uncomment to install TestKit backdoor in JIRA. -->
                    <!--
					<pluginArtifacts>
						<pluginArtifact>
							<groupId>com.atlassian.jira.tests</groupId>
							<artifactId>jira-testkit-plugin</artifactId>
							<version>${testkit.version}</version>
						</pluginArtifact>
					</pluginArtifacts>
					-->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <properties>
        <jira.version>7.1.0</jira.version>
        <amps.version>6.2.9</amps.version>
        <jira.software.application.version>7.5.0</jira.software.application.version>
        <jira.servicedesk.application.version>3.8.2</jira.servicedesk.application.version>
        <plugin.testrunner.version>1.2.3</plugin.testrunner.version>
        <!-- TestKit version 5.x for JIRA 5.x, 6.x for JIRA 6.x -->
        <testkit.version>5.2.26</testkit.version>
    </properties>
</project>

By the way, in IDEA, the version 3.6.2 for maven-compiler-plugin is highlighted red. Not sure if thats what you see on your end too and if that has anything to do with this issue.


#7

Hi @daniel,

I believe it was an outdated pom.xml file that was causing it.
I am running everything in CentOS now and IDEA seems to be happy for now.


#8

This worked for me, thanks!


#9

Thank you. It helped me a lot.

Why Atlassian does not update its documentation?