Hello,
In my Jira plugin, I want to use Jsoup in order to get some html elements, but I get the following error java.lang.NoClassDefFoundError: org/jsoup/Jsoup (I don't get any error when I'm using it from a simple Java project).
I've added the jsoup-1.8.2.jar to referenced libraries and restarted Jira.
Thanks!
Community moderators have prevented the ability to post new answers.
It seams that atlas-run doesn't do it's job properly, so after atlas-clean, I had to do atlas-compile and then atlas-package (they are included in atlas-run but aren't working as they should).
I also put the scope parameter and set it like this:
<dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.8.2</version> <scope>compile</scope> </dependency>
<scope>compile</scope> is default. So omitting it is fine. Important is to NOT to use <scope>provided</scope> that indicates that dependency is expected be provided at run-time by container and so is NOT packaged with plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you sure that compile is default? (I'm asking this because my project only worked after I've added that line - I didn't had the scope parameter declared at all)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope: compile This is the default scope, used if none is specified. Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrei,
JIRA plugins are packed as OSGI modules (https://developer.atlassian.com/docs/atlassian-platform-common-components/plugin-framework/behind-the-scenes-in-the-plugin-framework/going-from-plugin-to-osgi-bundle) and you can not load classes from the classpath.
Right way is to add dependency to pom.xml. I think it should look like:
<dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.8.2</version> </dependency>
After adding the dependency make sure to run
atlas-mvn eclipse:eclipse
in your project dir and refresh eclipse project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for such a fast answer! I've added that dependency and updated my project, but I still get the same error. (I've removed the old jar and, after updating, a new one has been added). I still don't get any error from eclipse so it can see the jsoup library ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Seems trivial but have you tried to run an "atlas-clean" command after changing dependencies? It might help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try to clean your dev JIRA instance by running in your project dir: atlas-clean And do not instantiate through reflection. Just plain java code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I've run the following: atlas-clean, atlas-mvn eclipse:eclipse and then atlas-debug
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It should work! Make sure that you have NOT copy pasted <scope>provided</scope> for your dependency.
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.