In maven project How to download the library in source/binary, mentioned in the <parent> tag in POM file?

不想你离开。 提交于 2020-01-07 01:52:27

问题


This is the pom file.

<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>

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

mvn dependency

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


回答1:


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.

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



来源:https://stackoverflow.com/questions/34946122/in-maven-project-how-to-download-the-library-in-source-binary-mentioned-in-the

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!