Hi, I’ve been trying to develop a small REST API plugin to expose some functions from com.atlassian.confluence.spaces, com.atlassian.confluence.security, and com.atlassian.confluence.user from the Java API. When running atlas-run, I’m getting the error message “package com.atlassian.confluence does not exist” for each of these imports.
My pom.xml includes the following dependency, and the rest of the pom.xml is just the generated pom.xml created when running atlas-create-confluence-plugin and selecting a REST API plugin:
Did you run the mvn install command to source the confluence dependency and add it to your local ~/.m2 folder? What was the output of that command? com.atlassian.confluence being missing when you try to run the plugin suggests that the dependency hasn’t been satisfied to complile your plugin successfully.
I’ve run atlas-mvn install, it runs fine until compile stage, where it fails out saying the same “package com.atlassian.confluence does not exist”. My local m2 folder has .m2\repository\com\atlassian\confluence and other atlassian dependencies populated, and everything seems to be there.
I’ve run atlas-mvn install, it runs fine until compile stage, where it fails out saying the same “package com.atlassian.confluence does not exist”. My local m2 folder has .m2\repository\com\atlassian\confluence and other atlassian dependencies populated, and everything seems to be there.
I realized I put this as a post reply, instead of a reply to you directly.
The problem you’re having sounds strange to me, I’m not sure what could be causing it. Have you tried to reproduce the problem with a simple “hello world” style plugin to see if there is anything specific to your plugin’s pom or atlassian-plugin.xml that might be causing this?
If you are comfortable sharing your code, I could try running it on my machine to see if I get the same problem?
I realized I put this as a post reply, instead of a reply to you directly.
No problem! I find the threading on this forum to be very confusing
Hi Joe, I’ve reproduced it on a “hello world” plugin generated by following this tutorial’s first few steps, substituting refapp for confluence. The plugin built fine, and then I added just the line “import com.atlassian.confluence.spaces” to MyRestResource.java. The pom.xml was generated with com.atlassian.confluence as a dependency. I’m a “new user” so I’m unable to upload any attachments to my comments, apparently, but I can copy/paste the body of my “MyRestResource.java” (the only file I changed from the generated confluence rest API module) and “pom.xml” files:
I wasn’t able to reproduce the problem with the pom and REST resource class you provided.
I did get this error trying to run the package command:
[ERROR] /Users/jclark/Dev/atlassian/test-confluence-plugin/src/main/java/com/atlassian/plugins/tutorial/api/MyRestResource.java:[4,32] cannot find symbol
symbol: class spaces
location: package com.atlassian.confluence
Which is a different error to yours. I fixed this problem by changing import com.atlassian.confluence.spaces; to import com.atlassian.confluence.spaces.*;
Which tutorial are you following and which version of the atlassian plugin SDK do you have installed?
Something else you could try is deleting everything from ~/.m2/repository/com/atlassian and trying to download all the dependencies again. Perhaps the Confluence jar was corrupted on download? If you do this, you could share the build log from running atlas-mvn install to see if there are any errors we can debug.