Getting compilation errors while creating a report plugin for jira

vimala nunavath June 5, 2012

Hi,

can any one help me to solve the follwing compilation errors as I am unable to solve them.

C:\atlassian-plugin-sdk\bin\jira-report-plugin>atlas-run
Executing: "C:\atlassian-plugin-sdk\apache-maven\bin\mvn.bat" com.atlassian.mave
n.plugins:maven-amps-dispatcher-plugin:3.10.4:run
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building jira-report-plugin
[INFO] task-segment: [com.atlassian.maven.plugins:maven-amps-dispatcher-plugi
n:3.10.4:run]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing amps-dispatcher:run
[INFO] [jira:copy-bundled-dependencies]
[INFO] [dependency:copy-dependencies]
[INFO] [jira:compress-resources]
[INFO] [yuicompressor:compress]
[INFO] nb warnings: 0, nb errors: 0
[INFO] [resources:resources]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO] [jira:filter-plugin-descriptor]
[INFO] [resources:copy-resources {execution: virtual-execution}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] [compiler:compile]
[INFO] Compiling 1 source file to C:\atlassian-plugin-sdk\bin\jira-report-plugin
\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

C:\atlassian-plugin-sdk\bin\jira-report-plugin\src\main\java\com\atlassian\plugi
ns\tutorial\jira\report\CreationReport.java:[12,34] error: cannot find symbol

could not parse error message: symbol: class I18nBean
location: package com.atlassian.jira.web.bean
C:\atlassian-plugin-sdk\bin\jira-report-plugin\src\main\java\com\atlassian\plugi
ns\tutorial\jira\report\CreationReport.java:16: error: package com.opensymphony.
user does not exist
import com.opensymphony.user.User;
^

C:\atlassian-plugin-sdk\bin\jira-report-plugin\src\main\java\com\atlassian\plugi
ns\tutorial\jira\report\CreationReport.java:[114,35] error: cannot find symbol

could not parse error message: symbol: class User
location: class CreationReport
C:\atlassian-plugin-sdk\bin\jira-report-plugin\src\main\java\com\atlassian\plugi
ns\tutorial\jira\report\CreationReport.java:122: error: cannot find symbol
private void getIssueCount(Date startDate, Date endDate, Long interval, User
remoteUser, Long projectId) throws SearchException
^

could not parse error message: symbol: class User
location: class CreationReport
C:\atlassian-plugin-sdk\bin\jira-report-plugin\src\main\java\com\atlassian\plugi
ns\tutorial\jira\report\CreationReport.java:61: error: cannot find symbol
User remoteUser = action.getRemoteUser();
^

could not parse error message: symbol: class User
location: class CreationReport
C:\atlassian-plugin-sdk\bin\jira-report-plugin\src\main\java\com\atlassian\plugi
ns\tutorial\jira\report\CreationReport.java:62: error: cannot find symbol
I18nHelper i18nBean = new I18nBean(remoteUser);
^

could not parse error message: symbol: class I18nBean
location: class CreationReport
C:\atlassian-plugin-sdk\bin\jira-report-plugin\src\main\java\com\atlassian\plugi
ns\tutorial\jira\report\CreationReport.java:156: error: cannot find symbol
User remoteUser = action.getRemoteUser();
^

could not parse error message: symbol: class User
location: class CreationReport
C:\atlassian-plugin-sdk\bin\jira-report-plugin\src\main\java\com\atlassian\plugi
ns\tutorial\jira\report\CreationReport.java:157: error: cannot find symbol
I18nHelper i18nBean = new I18nBean(remoteUser);
^


[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22 seconds
[INFO] Finished at: Wed Jun 06 14:34:32 CEST 2012
[INFO] Final Memory: 61M/316M
[INFO] ------------------------------------------------------------------------
C:\atlassian-plugin-sdk\bin\jira-report-plugin>

Thanks for the answers in advance!!

Regards,

Vimala

1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 5, 2012

Your code refers to stuff that changed in Jira 4.3, you need to update it with the new API calls to do what you need. I'm assuming you've got a plugin or code for Jira 4.2 or below and are trying to update it?

vimala nunavath June 5, 2012

Thanks for the anser. I am actually trying to create a jira report plugin (for jira5.0) to get the monthly basis report on the selected project in jira.

To create a plugin I have followed the given link (https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Creating+a+JIRA+Report) and used the code (http://svn.atlassian.com/svn/public/contrib/tutorials/jira-report-plugin/trunk/).

When I gave atlas-run command, I got earlier mentioned error.

pls help me with the report creation.

Regards,

Vimala

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 5, 2012

That's rather old code I'm afraid - if you look at the pom.xml, you'll see it says "jira version 4.1" near the end, and that's from before Atlassian swapped osuser for crowd. However, that should actually make it compile for 4.1, so I assume you've already changed it to 5.0

You might be better off using example code from one of the open source plugins, or possibly starting with a clean plugin (atlas-create-jira-plugin) and building towards what you need instead of taking a pre-existing block.

vimala nunavath June 6, 2012

Hi Nic,

Could you let me know where can I find the example code of the open source plugins?

Thanks for the answer in advance!!

Regards,

Vimala

Suggest an answer

Log in or Sign up to answer