elasticsearch,lucene,dependencies,carrot2,Maven,elasticsearch,Lucene,Dependencies,Carrot2" /> elasticsearch,lucene,dependencies,carrot2,Maven,elasticsearch,Lucene,Dependencies,Carrot2" />

Maven依赖项的内部属性

Maven依赖项的内部属性,maven,elasticsearch,lucene,dependencies,carrot2,Maven,elasticsearch,Lucene,Dependencies,Carrot2,技术:Maven 3+IntelliJ+ElasticSearch 5.5.0+Carrot2 3.15.1 我有一个关于Carrot2和ElasticSearch的项目,这会引起一些冲突。Carrot2使用Lucene 5.3.1,ElasticSearch使用6.3.1版本。我想强制carrot2使用6.3.1 Lucene版本来修复它 我已尝试在项目的主pom文件中添加属性: <properties> <project.build.sourceEncoding&g

技术:Maven 3+IntelliJ+ElasticSearch 5.5.0+Carrot2 3.15.1

我有一个关于Carrot2和ElasticSearch的项目,这会引起一些冲突。Carrot2使用Lucene 5.3.1,ElasticSearch使用6.3.1版本。我想强制carrot2使用6.3.1 Lucene版本来修复它

我已尝试在项目的主pom文件中添加属性:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <java.version>1.8</java.version>
    <elasticsearch.version>5.4.2</elasticsearch.version>
    <org.apache.lucene.version>6.5.1</org.apache.lucene.version>
</properties>
<parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>5</version>
</parent>

<groupId>org.carrot2</groupId>
<artifactId>carrot2</artifactId>
<version>3.15.1</version>

<name>Carrot2</name>
(...)
<properties>
(...)
    <org.apache.lucene.version>6.5.1</org.apache.lucene.version>     
    <org.simpleframework.version>2.7.1</org.simpleframework.version>
    <org.carrot2.attributes>1.3.1</org.carrot2.attributes>
</properties>

UTF-8
1.8
5.4.2
6.5.1
不幸的是,这种方式仍然会产生由Lucene版本冲突引起的错误。 最后,我通过更改carrot的dependency pom文件的内部值找到了本地机器的解决方案:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <java.version>1.8</java.version>
    <elasticsearch.version>5.4.2</elasticsearch.version>
    <org.apache.lucene.version>6.5.1</org.apache.lucene.version>
</properties>
<parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>5</version>
</parent>

<groupId>org.carrot2</groupId>
<artifactId>carrot2</artifactId>
<version>3.15.1</version>

<name>Carrot2</name>
(...)
<properties>
(...)
    <org.apache.lucene.version>6.5.1</org.apache.lucene.version>     
    <org.simpleframework.version>2.7.1</org.simpleframework.version>
    <org.carrot2.attributes>1.3.1</org.carrot2.attributes>
</properties>

org.sonatype.oss
oss父级
5.
org.2
胡萝卜2
3.15.1
胡萝卜2
(...)
(...)
6.5.1     
2.7.1
1.3.1

它工作正常,但只在我的本地机器上。在carrot的pom文件中更改的Lucene版本似乎没有传播,需要在项目的任何实例上手动更改此版本。是否有可能强制maven在外部依赖中使用我的项目属性值?

@Val谢谢。一点解释:

我在问题的一开始就尝试了添加排除,但仅限于
lucene-core
。它在我的Windows机器上不工作,但在另一个基于linux的平台上似乎工作正常。我添加了以下排除项,并且它似乎适用于任何机器:

<dependency>
    <groupId>org.carrot2</groupId>
    <artifactId>carrot2-core</artifactId>
    <version>3.15.1</version>
    <exclusions>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-analyzers-common</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-backward-codecs</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-highlighter</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-memory</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-queryparser</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-analyzers-smartcn</artifactId>
        </exclusion>
    </exclusions>
</dependency>

org.2
胡萝卜2核
3.15.1
org.apache.lucene
lucene岩芯
org.apache.lucene
lucene分析仪通用
org.apache.lucene
lucene反向编解码器
org.apache.lucene
lucene荧光灯
org.apache.lucene
lucene存储器
org.apache.lucene
卢克尼探险家
org.apache.lucene
lucene分析仪smartcn
然而,只返回到一个exlusion
lucenecore
在我的ubuntu+intellij17+maven 3.3.9上运行良好,但在windows+intellij14+maven 3.3.3上不起作用

程序: Maven清理->重新导入所有Maven项目->重建


似乎这两种配置都有不同的重建/缓存策略,这让我感到困惑。

@Val谢谢。一点解释:

我在问题的一开始就尝试了添加排除,但仅限于
lucene-core
。它在我的Windows机器上不工作,但在另一个基于linux的平台上似乎工作正常。我添加了以下排除项,并且它似乎适用于任何机器:

<dependency>
    <groupId>org.carrot2</groupId>
    <artifactId>carrot2-core</artifactId>
    <version>3.15.1</version>
    <exclusions>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-analyzers-common</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-backward-codecs</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-highlighter</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-memory</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-queryparser</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-analyzers-smartcn</artifactId>
        </exclusion>
    </exclusions>
</dependency>

org.2
胡萝卜2核
3.15.1
org.apache.lucene
lucene岩芯
org.apache.lucene
lucene分析仪通用
org.apache.lucene
lucene反向编解码器
org.apache.lucene
lucene荧光灯
org.apache.lucene
lucene存储器
org.apache.lucene
卢克尼探险家
org.apache.lucene
lucene分析仪smartcn
然而,只返回到一个exlusion
lucenecore
在我的ubuntu+intellij17+maven 3.3.9上运行良好,但在windows+intellij14+maven 3.3.3上不起作用

程序: Maven清理->重新导入所有Maven项目->重建


似乎两种配置都有不同的重建/缓存策略,这让我感到困惑。

您是否尝试过从carrot版本中删除Lucene依赖项?不知道您想做什么,但我建议使用此插件:并坚持所有项目的兼容版本(ES、C2、插件本身).你试过从carrot one中删除Lucene依赖项吗?不知道你想做什么,但我建议使用这个插件:并坚持所有项目的兼容版本(ES、C2、插件本身)。