In maven project How to download the library in so

2019-09-14 03:34发布

问题:

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.