本文介绍了是否自动使用dependency-reduced-pom.xml而不是pom.xml?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Maven阴影插件 自动创建的dependency-reduced-pom.xml 用于依赖uberjar的项目(而不是普通的pom.xml)吗?

在阅读了一些与dependency-reduced-pom.xml相关的问题之后,还没有找到答案,就问了这个问题:

Asking this after reading a number of dependency-reduced-pom.xml related questions and haven't founding the answer:

Maven阴影插件添加了减少依赖的功能-pom.xml到基本目录

什么插件生成的dependency-reduced-pom.xml的目的是什么?

什么是`调用maven软件包命令时创建的dependency-reduced-pom.xml文件?

推荐答案

dependency-reduced-pom.xml是在构建时生成到项目的${basedir}中的.该文件是一个临时文件,仅用于包装到有阴影的jar中.引用 createDependencyReducedPom 属性的文档:

The dependency-reduced-pom.xml is generated at build time into ${basedir} of the project. This file is a temporary file that is only used for packaging into the shaded jar. Quoting the documentation of the createDependencyReducedPom attribute:

为了清楚起见,请在maven-shade-plugin运行后:

To make it clear, after the maven-shade-plugin has run:

  • 您的初始POM将保持不变;
  • 将在根文件夹中生成一个可以完全忽略的名为dependency-reduced-pom.xml的临时文件();
  • 带阴影的工件将在META-INF目录中包含未更改的初始POM,而不包含减少的POM(这不是很重要,但最好提及它-存在一个已自动关闭的问题:MSHADE-36 );
  • 将要部署的POM是简化的POM;
  • 带阴影的工件默认情况下将是项目的主要工件.
  • your initial POM will be left unchanged;
  • a temporary file that you can completely ignore named dependency-reduced-pom.xml will have been generated inside the root folder (this is considered an open issue with this plugin);
  • the shaded artifact will contain your initial POM unchanged inside the META-INF directory and not the reduced POM (this is not really important but better mention it - there was an issue about this that was closed automatically: MSHADE-36);
  • the POM that will be deployed is the reduced POM;
  • the shaded artifact will be by default the main artifact of the project.

这篇关于是否自动使用dependency-reduced-pom.xml而不是pom.xml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 17:42