技術的內部屬性:Maven的3 +的IntelliJ + ElasticSearch 5.5.0 + Carrot2 3.15.1Maven的依賴
我有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>
不幸的是這種方式仍然上升引起的Lucene的版本衝突的錯誤。 最後,我發現我的本地機器的解決方案,通過改變胡蘿蔔的依賴POM文件的內在價值:
<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>
它工作正常,但只有我的本地機器上。在胡蘿蔔的pom文件中更改的Lucene版本似乎沒有傳播,需要手動更改此版本的任何項目實例。有沒有可能強制maven在外部依賴中使用我的項目屬性值?
您是否嘗試過[從https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html中)從胡蘿蔔的Lucene依賴? – Val
不知道你在做什麼,但我建議使用這個插件:https://github.com/carrot2/elasticsearch-carrot2並堅持所有項目的兼容版本(ES,C2,插件本身)。 –