【问题标题】:Maven choosing either stanford-corenlp models or non-models, not bothMaven 选择 stanford-corenlp 模型或非模型,而不是两者
【发布时间】:2018-05-15 22:44:51
【问题描述】:

文档说包括:

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

不幸的是,在尝试构建 RPM 时,程序集插件输出:

[INFO] [INFO] 读取程序集描述符:src/main/assembly/assembly.xml [INFO] [INFO] lib/stanford-corenlp-3.8.0.jar 已经添加,跳过

在最终结果中我们只得到第一个罐子,而不是模型罐子。

我知道这是我们这边的事情,因为它对其他人来说似乎工作正常,但是有没有人知道可能出了什么问题?搜索与跳过“分类器”部分的 maven 相关的任何内容都不起作用,因为分类器一词在很多上下文中使用。

【问题讨论】:

    标签: maven stanford-nlp


    【解决方案1】:

    我们最终找到了答案——在我们的 assembly.xml 中,我们得到了这个:

    <dependencySet>
      <outputFileNameMapping>${artifact.artifactId}-${artifact.version}.${artifact.extension}</outputFileNameMapping>
      <outputDirectory>/lib</outputDirectory>
      <useProjectArtifact>true</useProjectArtifact>
      <useTransitiveDependencies>true</useTransitiveDependencies>
      <unpack>false</unpack>
      <scope>runtime</scope>
    </dependencySet>
    

    outputFileNameMapping 值覆盖了默认值,并且缺少包含分类器的段:${dashClassifier?}

    当前 Maven 默认为:${module.artifactId}-${module.version}${dashClassifier?}.${module.extension}

    所以我们刚刚删除了 outputFileNameMapping 声明并对其进行了修复。

    https://maven.apache.org/plugins/maven-assembly-plugin/assembly.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多