zoukankan      html  css  js  c++  java
  • 解决Maven 报 Return code is: 400 , ReasonPhrase:Repository version policy: SNAPSHOT does not allow version: 2.1.0.RELEASE. 的错误

      最近在搭建公司的基础框架,业务需求用到elasticsearch,所以需要整合到基础框架里,供各业务线使用同时也便于管理,但在整合的过程中,出现了莫名的问题,同时maven的提示也不够明确。

     我的版本信息为 spring boot 2.1.0.RELEASE,elasticsearch 6.3.1,因为不同版本可能遇到的问题不一样。

          我的POM包引用为
    <parent>
    
        <groupId>org.springframework.boot</groupId>
    
        <artifactId>spring-boot-starter-parent</artifactId>
    
        <version>2.1.0.RELEASE</version>
    
        <relativePath/> 
    
    </parent>
     
    <dependency>
    
        <groupId>org.springframework.boot</groupId>
    
        <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    </dependency>
    
    
          我的错误提示为如下图,Return code is: 400 , ReasonPhrase:Repository version policy: SNAPSHOT does not allow version: 2.1.0.RELEASE.,你能查询的解决方案几乎都是修改私有仓库级别,但对我遇到的问题并不可行,

    
    
    这里出现的问题跟私有库没关系,是包之间的不兼容造成的,解决步骤就是把出现问题的包一一排查,要求就是你要熟悉根据每步的提示,找到要排除的包,然后引用兼容的包,最后我的POM设置如下,同时解决elasticsearch 与redis 冲突的问题。
     
    <dependency>
    
        <groupId>org.springframework.boot</groupId>
    
        <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    
        <exclusions>
    
            <exclusion>
    
                <groupId>org.elasticsearch.client</groupId>
    
                <artifactId>transport</artifactId>
    
            </exclusion>
    
            <exclusion>
    
                <groupId>org.elasticsearch.plugin</groupId>
    
                <artifactId>transport-netty4-client</artifactId>
    
            </exclusion>
    
        </exclusions>
    
    </dependency>
    
    <dependency>
    
        <groupId>org.elasticsearch.plugin</groupId>
    
        <artifactId>transport-netty4-client</artifactId>
    
        <exclusions>
    
            <exclusion>
    
                <groupId>org.elasticsearch.client</groupId>
    
                <artifactId>transport</artifactId>
    
            </exclusion>
    
        </exclusions>
    
        <version>6.3.1</version>
    
    </dependency>
    
    <dependency>
    
        <groupId>org.elasticsearch.client</groupId>
    
        <artifactId>transport</artifactId>
    
        <version>6.3.1</version>
    
        <exclusions>
    
            <exclusion>
    
                <groupId>org.elasticsearch</groupId>
    
                <artifactId>elasticsearch</artifactId>
    
            </exclusion>
    
            <exclusion>
    
                <groupId>org.elasticsearch.client</groupId>
    
                <artifactId>elasticsearch-rest-client</artifactId>
    
            </exclusion>
    
            <exclusion>
    
                <groupId>org.elasticsearch.plugin</groupId>
    
                <artifactId>transport-netty4-client</artifactId>
    
            </exclusion>
    
        </exclusions>
    
    </dependency>
    
    <dependency>
    
        <groupId>org.elasticsearch.client</groupId>
    
        <artifactId>elasticsearch-rest-client</artifactId>
    
        <version>6.3.1</version>
    
    </dependency>
    
    <dependency>
    
        <groupId>org.elasticsearch</groupId>
    
        <artifactId>elasticsearch</artifactId>
    
        <version>6.3.1</version>
    
    </dependency>
     然后运行 >mvn clean compile package -U,可以看到熟悉的BUILD SUCCESS。

    
    
  • 相关阅读:
    leetcode面试准备:Kth Largest Element in an Array
    leetcode面试准备:Minimum Size Subarray Sum
    leetcode面试准备:Valid Anagram
    leetcode面试准备:Divide Two Integers
    leetcode面试准备:Container With Most Water
    面试:归并排序和分治法
    leetcode面试准备:Lowest Common Ancestor of a Binary Search Tree & Binary Tree
    Leetcode解题思想总结篇:双指针
    leetcode面试准备: CountPrimes
    RF中BDD编写
  • 原文地址:https://www.cnblogs.com/lzh-boy/p/9995900.html
Copyright © 2011-2022 走看看