Maven排除特定版本放入胖子

我正在一个项目中,其中Springboot jar和Hive jar由于重复版本而产生冲突

   <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-jdbc</artifactId>
        <version>3.1.0.3.1.0.0-78</version>
 </dependency>

上面的蜂巢罐是胖罐,并且有很多重复的依赖关系,在下面的示例中,您可以看到两个版本2.6.0和3.1.1.3.1.0.0-78

现在,如果我们要添加排除

        <exclusions>
            <exclusion>
                <artifactId>XX</artifactId>
                <groupId>YYY</groupId>
            </exclusion>
         </exclusions>
  

现在我只想排除2.6.0版本并保留3 3.1.1.3.1.0.0-78   ,是否有任何选项可以定义排除的jar版本?

[WARNING] 
Dependency convergence error for org.apache.hadoop:hadoop-auth:2.6.0 paths to dependency are:
+-com.syf.gemfire:jdbc-gemfire-dataloader-pcf:2.0.0
  +-org.apache.hive:hive-jdbc:3.1.0.3.1.0.0-78
    +-org.apache.hive:hive-common:3.1.0.3.1.0.0-78
      +-com.github.joshelser:dropwizard-metrics-hadoop-metrics2-reporter:0.1.2
        +-org.apache.hadoop:hadoop-common:2.6.0
          +-org.apache.hadoop:hadoop-auth:2.6.0
and
+-com.syf.gemfire:jdbc-gemfire-dataloader-pcf:2.0.0
  +-org.apache.hive:hive-jdbc:3.1.0.3.1.0.0-78
    +-org.apache.hive:hive-service:3.1.0.3.1.0.0-78
      +-org.apache.hive:hive-llap-server:3.1.0.3.1.0.0-78
        +-org.apache.hbase:hbase-hadoop2-compat:2.0.2.3.1.0.0-78
          +-org.apache.hadoop:hadoop-mapreduce-client-core:3.1.1.3.1.0.0-78
            +-org.apache.hadoop:hadoop-yarn-common:3.1.1.3.1.0.0-78
              +-org.apache.hadoop:hadoop-auth:3.1.1.3.1.0.0-78
and
+-com.syf.gemfire:jdbc-gemfire-dataloader-pcf:2.0.0
  +-org.apache.hive:hive-jdbc:3.1.0.3.1.0.0-78
    +-org.apache.hive:hive-service:3.1.0.3.1.0.0-78
      +-org.apache.hive:hive-llap-server:3.1.0.3.1.0.0-78
        +-org.apache.hbase:hbase-server:2.0.2.3.1.0.0-78
          +-org.apache.hbase:hbase-http:2.0.2.3.1.0.0-78
            +-org.apache.hadoop:hadoop-auth:3.1.1.3.1.0.0-78
yzhkof1 回答:Maven排除特定版本放入胖子

要解决依赖项收敛错误,请在from bokeh.plotting import figure,show,output_file from bokeh.palettes import Reds data_dict={'state':['New York','New Mexico','New York','New Mexico'],'feature':['poverty','poverty','unemployment','unemployment'],'color':=[Reds[9][0],Reds[9][1],Reds[9][2],Reds[9][3]} p = figure(title="testing",tools="hover",toolbar_location=None,x_range=data_dict['feature'],y_range=data_dict['state']) p.rect('feature','state',source=data_dict,color='color',width=1,height=1) p.grid.grid_line_color = None p.axis.axis_line_color = None p.axis.major_tick_line_color = None p.axis.major_label_text_font_size = "10pt" p.axis.major_label_standoff = 0 p.xaxis.major_label_orientation = np.pi/3 show(p)``` Eliminate all the whitespace in the plot. 中添加条目,在其中指定所需的版本

<dependencyManagement>

然后,所有通过传递方式找到的版本都将替换为您指定的版本,一旦冲突消失。

本文链接:https://www.f2er.com/3142963.html

大家都在问