在Maven项目中,如何在< parent>中提到的以源/二进制形式下载库.在POM文件中标记? [英] In maven project How to download the library in source/binary, mentioned in the <parent> tag in POM file?

查看:90
本文介绍了在Maven项目中,如何在< parent>中提到的以源/二进制形式下载库.在POM文件中标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是pom文件.

<project>
 <parent>
   <groupId>org.jboss.weld</groupId>
   <artifactId>weld-api-bom</artifactId>
   <version>1.0</version>
   <relativePath>../bom/pom.xml</relativePath>
 </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>my-module</artifactId>

  <dependencies>
  <dependency>
     <groupId>javax.el</groupId>
     <artifactId>el-api</artifactId>
     <optional>true</optional>
  </dependency>
  </dependencies>

</project>

我知道,要下载依赖项(在其"el-api"之上),我们应该使用

I know, to download the dependencies(above its "el-api") we should use

mvn dependency

但是用于下载父项依赖项(即weld-api-bom)的命令是什么?

But what is the command used to download the parent dependency(i.e weld-api-bom)?

推荐答案

鉴于您的父pom有 ../bom/pom.xml 它既可以下载(如果在配置的存储库中可用),也可以从磁盘读取(如果有的话). 无论如何,大多数maven命令都会触发此工件的下载,这是构建的第一步.

Given your parent pom has ../bom/pom.xml It could either be downloaded (if avaiable in configured repository) or be read from disk if it there. In any case most of the maven commands will trigger the download of this artifact as one of the very first steps of the build.

请注意,"mvn依赖项"不是有效的命令.

Please also note that "mvn dependency" is not a valid command.

这篇关于在Maven项目中,如何在&lt; parent&gt;中提到的以源/二进制形式下载库.在POM文件中标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆