It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

1 vote
Answer accepted

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
Community showcase
Published in Jira

Keep your team in the loop with Team @mentions in Jira Software!

Hi everyone! My name is Jenny, a Product Manager at Atlassian. After launching Team @mentions in Confluence, we heard a lot of positive feedback from customers that they love how easy it is to @men...

437 views 5 15
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you