I'm attempting to build a plugin.
I created the plugin skeleton, created a web-item, and a web-work. I added a log statement in the web-work's execute method, andt hen tried to run atlas-run in my plugin directory. When it's building I got the error .../webwork/StatusRefreshWebWorkAction.java:[5,37] package com.atlassian.jira.web.action does not exist
.
So I found something online that suggested adding JIRA as a Maven dependency. I'm pretty certain this is my issue. But, I'm getting errors when trying to add this dependency.
I tried adding:
<dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-api</artifactId> <version>${jira.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-core</artifactId> <version>${jira.version}</version> <scope>provided</scope> </dependency>
And then:
<dependency> <groupId>com.atlassian.jira</groupId> <artifactId>atlassian-jira</artifactId> <version>${jira.version}</version> <scope>provided</scope> </dependency>
'dependencies.dependency.version' for com.atlassian.jira:atlassian-jira:jar must be a valid version but is '${jira.version}'
...Community moderators have prevented the ability to post new answers.
OK so the underlying problem was that I already had a Maven settings.xml file on my system that was used when I created the plugin.
I added the info from the Maven settings.xml that came w/ the Atlassian SDK & put them into my system's Maven settings.xml file. Then I re-created my plugin and the pom.xml was generated with the correct information.
atlassian-jira
dependency won't work. You need only jira-api dependency for webwork actions, unless you are using some core classes in the code. In that case, use jira-core dependency as well.
Make sure you rebuild the project for your IDE and refresh the same in the IDE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Forgot to mention that pom.xml should be updated to reflect the version of JIRA you are developing for!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jobin Kuruvilla [Go2Group] thanks for the response.
I do plan on using some core classes in the code. I changed the pom.xml back to using the dependencies:
<dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-api</artifactId> <version>${jira.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-core</artifactId> <version>${jira.version}</version> <scope>provided</scope> </dependency>
I'm not using an IDE at the moment. When trying to run I get the following error, the same as before:
C:\Users\ANDY_BOUTIN\Desktop\atlassian-workspace\statusrefreshbutton>atlas-run
Executing: "C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.2\apache-maven-3.
2.1\bin\mvn.bat" com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:"6.2.1
":run -gs C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.2\apache-maven-3.2.
1/conf/settings.xml
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; sup
port was removed in 8.0
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.custom:statusrefreshbutton:1.0-SNAPSHOT (C:\Users\ANDY
_BOUTIN\Desktop\atlassian-workspace\statusrefreshbutton\pom.xml) has 2 errors
[ERROR] 'dependencies.dependency.version' for com.atlassian.jira:jira-api:ja
r must be a valid version but is '${jira.version}'. @ line 19, column 14
[ERROR] 'dependencies.dependency.version' for com.atlassian.jira:jira-core:j
ar must be a valid version but is '${jira.version}'. @ line 25, column 14
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
gException
C:\Users\ANDY_BOUTIN\Desktop\atlassian-workspace\statusrefreshbutton>
You said to make sure that I update the pom.xml to the version of JIRA that I'm using. Where exactly do I update that? Am I supposed to replace ${jira.version} w/ my JIRA version or am I supposed to have a variable jira.version defined somewhere?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you need to have it under properties. <properties> ... <jira.version>7.0.0</jira.version> .... </properties>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For some reason mine was named platform.version - I changed all occurrences of it to jira.version - thank you. I also needed to update my existing settings.xml file w/ the required info for using the atlassian SDK since I already had Maven on my system & it was defaulting to the already installed one. Thanks for the help, slowly getting there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.