POM to Global Library

Answered

I have some dependencies in my Maven pom.xml that I would like to setup as global libraries, but I'm not quite sure how to do it. I have tried the Google approach for an answer, but I think I'm missing some of the vocabulary to get at an answer.

I created a generic project along with Maven to work with Stanford CoreNLP.

<dependencies>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.9.2</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.9.2</version>
<classifier>models</classifier>
</dependency>
</dependencies>

Using this approach, everything compiles and I'm able to identify use their natural language processing to get tokens, sentences, and parts of speech.

I created a separate project to try to work with Global Libraries. I went into the Global Libraries and was able to find edu.stanford.nlp:stanford-corenlp:3.9.2, but I couldn't find a way to input the "models" classifier. I saw in the Maven panel it referenced edu.stanford.nlp:stanford-corenlp:models:3.9.2, but adding it using that reference in the Global Library only created a second copy of the previous dependency. So I get the impression I'm still doing it wrong. Without this part, I get errors using the same code files because it doesn't have the models (the second dependency).

Is there a way to convert these dependencies from a Maven pom file into a global library?

0
2 comments

The libraries you define in Maven pom.xml file are stored per project - in Project Structure | Libraries node. The Project Structure | Global Libraries you must define via the IDE interface.

>Is there a way to convert these dependencies from a Maven pom file into a global library?

Yes it is possible, you can move the project library to a global one, see Change library level.
0
Avatar
Permanently deleted user

Thanks for pointing out the obvious! I hadn't spotted the new items in my project libraries since I thought it was solely housed in the pom file. I knew a number of settings were updated from the pom file, but overlooked that one. Very much appreciated!

0

Please sign in to leave a comment.