【问题标题】:why don't use scope maven dependency Management?为什么不使用范围Maven依赖管理?
【发布时间】:2013-07-17 08:44:00
【问题描述】:

如果我在父母的 pom 中定义了这个依赖:

<dependencyManagement> 
    <dependencies>
      <dependency>
         <groupId>org.springframework<groupId>
         <artifactId>spring-core<artifactId>
         <version>3.1.0.RELEASE</version>
      </dependency>

在其中一个孩子中:

<project>
  <dependencies>
    <dependency> // note: no version declared
      <groupId>org.springframework<groupId>
      <artifactId>spring-core<artifactId>
    </dependency>

那么,范围?总是编译,还是我可以指定?

【问题讨论】:

    标签: maven pom.xml parent-pom


    【解决方案1】:

    compile 是依赖项的默认范围 (pom reference)。您也可以指定范围,它将被继承

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-18
      • 1970-01-01
      • 2013-02-19
      • 2015-07-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多