在练习淘淘商城中配置ssm文件,一直报错:Missing artifact junit:junit:jar:${junit.version}

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>cn.itcast.usermanage</groupId>
  <artifactId>itcast-usermanage</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <packaging>war</packaging>
  <properties>
    <failOnMissingWebXml>false</failOnMissingWebXml>
  </properties>

  <dependencies>
            <!-- 单元测试 -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
</dependencies>
</project>

报错的地方就是:<!-- 单元测试 --> → 错误提示 Missing artifact junit:junit:jar:${junit.version}
这个是在子项目的中配置pom.xml一直提示这样的错误!我配置的仓库文件全部都有!

没有继承父工程

    <parent>
        <groupId></groupId>
        <artifactId></artifactId>
        <version></version>
        <relativePath>../pom.xml</relativePath>
    </parent>

没有定义${junit.version}

解决方法一:直接写version

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>test</scope>
</dependency>

解决方法二:<properties>里面定义在${junit.version}

<properties>
<junit.version>4.12</junit.version>
</properties>