Proper way to add dependency Edited

I'm trying to use Stanford CoreNLP on my plugin module (Web-Panel), so I added the following dependencies to pom.xml:

<dependency> 
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>${corenlp.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>${corenlp.version}</version>
<classifier>models</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>${corenlp.version}</version>
<classifier>models-spanish</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>${slf4j.version}</version>
<scope>provided</scope>
</dependency>

where properties:

<properties>
<corenlp.version>3.8.0</corenlp.version>
<slf4j.version>1.7.25</slf4j.version>

<jira.version>7.2.2</jira.version>
<amps.version>6.2.11</amps.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
<testkit.version>6.3.11</testkit.version>
</properties>

 I also added it in Import-Package:

<Import-Package>
edu.stanford.*;resolution:="optional",
org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional",
*;version="0";resolution:=optional
</Import-Package>

then I got this error message:

The following plugins failed to load:
web-panel-comment: A required class was missing: java.lang.Void. Please check that you have all of the required dependencies.<br/>edu/stanford/nlp/pipeline/Annotation

Did I miss something here?...

Sincerely,

1 answer

1 accepted

This widget could not be displayed.
Aleksandr Zuevich Community Champion Oct 20, 2017

Hi.

I suppose you need scope compile for edu.stanford.nlp dependencies.

Hi @Aleksandr Zuevich, thank you so much for the reply.

I had tried to use the scope compile, but got another message:

___ FAILED PLUGIN REPORT _____________________

1 plugin failed to load during JIRA startup.
'com.comment.plugins.nlp.web-panel-comment' - 'web-panel-comment' failed to load.
Unexpected exception parsing XML document from URL [bundle://167.0:0/META-INF/spring/plugin-context.xml]; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) previously initiated loading for a different type with name "org/w3c/dom/Element" loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) previously initiated loading for a different type with name "org/w3c/dom/Element"

So I had to set exclussion on those Stanford CoreNLP dependencies:

<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>

and after occured a problem with Java heap size...,  so I added the following JVM argument in com.atlassian.maven.plugins <configuration>:

<jvmArgs>-Xmx2g -XX:MaxPermSize=1g</jvmArgs>

Everything works fine now.
Thanks.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

216 views 3 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you