Maven dependency:get does not download Stanford NLP model files

回眸只為那壹抹淺笑 提交于 2019-11-30 11:33:11

First thanks for your question. It answered my question about how to include both the data and the lib. I'll share what I'm doing with Maven, but I'm not sure this satisfies your question:

<dependency>
  <groupId>edu.stanford.nlp</groupId>
  <artifactId>stanford-corenlp</artifactId>
  <version>1.3.4</version>
  <classifier>models</classifier>
</dependency>
<dependency>
      <groupId>edu.stanford.nlp</groupId>
      <artifactId>stanford-corenlp</artifactId>
      <version>1.3.4</version>
    </dependency>
    <dependency>
      <groupId>edu.stanford.nlp</groupId>
      <artifactId>stanford-parser</artifactId>
      <version>2.0.4</version>
    </dependency>

Also, make sure my jar includes the libs I use:

  <build>
  <plugins>
    <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <configuration>
        <archive>
          <manifest>
            <mainClass>org.example.nlpservice.NLP</mainClass>
          </manifest>
        </archive>
        <descriptorRefs>
          <descriptorRef>jar-with-dependencies</descriptorRef>
        </descriptorRefs>
      </configuration>
      <executions>
        <execution>
          <id>make-assembly</id> <!-- this is used for inheritance merges -->
          <phase>package</phase> <!-- bind to the packaging phase -->
          <goals>
            <goal>single</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
   </build>

Finally, have you tried mvn deploy or mvn install yet? You could copy from your local mvn cache/repo into a /lib directory.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!