title: SpringBoot does not run unit tests when added into dependencyManagement
body: <p>My project is supposed to be inherited from a custom parent and at the same time use <code>Spring Boot</code>.
  The standard solution for that is using <code>&lt;dependencyManagement&gt;</code> section as described <a href="https://www.baeldung.com/spring-boot-dependency-management-custom-parent" rel="nofollow noreferrer">here</a>.</p>
  
  <p>The problem is when a <code>Spring Boot</code> dependency is added into the section, maven does not see any unit tests (Test runs = 0). I reproduced that with artifacts <code>spring-boot-dependencies</code> and <code>spring-boot-starter</code>.</p>
  
  <p>Steps to reproduce:</p>
  
  <ol>
  <li>create a maven project with one unit test <code>SampleTest</code> and the following pom.</li>
  <li>run <code>mvn test</code>.</li>
  <li>see that <code>SampleTest</code> has run and failed</li>
  <li>uncomment the block in <code>&lt;dependencyManagement&gt;</code> to import <code>Spring Boot</code></li>
  <li>run <code>mvn test</code></li>
  <li>see no tests have run and the build is succesfull.</li>
  </ol>
  
  <p>I had similar problems with older versions of <code>surefire</code>, which could not find <code>JUnit5</code> tests in a similar manner. But the effective pom shows that in this case plugins' versions are correctly set to <code>3.0.0-M4</code> and not overridden by SpringBoot.</p>
  
  <p><strong>Could you help me fix the problem with running tests and properly apply <code>Spring Boot</code> in this case?</strong></p>
  
  <hr>
  
  <p><code>src/test/java/org/example/SampleTest.java</code></p>
  
  <pre><code>package org.example;
  
  import org.junit.jupiter.api.*;
  
  class SampleTest{
      @Test
      void test(){
          Assertions.assertEquals(0, 1);
      }
  }
  </code></pre>
  
  <hr>
  
  <p><code>pom.xml</code></p>
  
  <blockquote>
    <p>The following sample does not have a parent: I've just copied plugins
    and dependencies from that to keep it concise.</p>
  </blockquote>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;org.example&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-import&lt;/artifactId&gt;
      &lt;version&gt;1.0&lt;/version&gt;
  
      &lt;dependencyManagement&gt;
      &lt;!-- when this block is uncommented no unit tests are found in the project--&gt;
  
      &lt;!--
          &lt;dependencies&gt;
            &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;
              &lt;version&gt;2.2.5.RELEASE&lt;/version&gt;
              &lt;type&gt;pom&lt;/type&gt;
              &lt;scope&gt;import&lt;/scope&gt;
            &lt;/dependency&gt;
          &lt;/dependencies&gt;
      --&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;properties&gt;
          &lt;version.java&gt;11&lt;/version.java&gt;
          &lt;version.junit.jupiter&gt;5.6.0&lt;/version.junit.jupiter&gt;
      &lt;/properties&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.8.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;compilerVersion&gt;${version.java}&lt;/compilerVersion&gt;
                      &lt;release&gt;${version.java}&lt;/release&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.0.0-M4&lt;/version&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.0.0-M4&lt;/version&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter-engine&lt;/artifactId&gt;
              &lt;version&gt;${version.junit.jupiter}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>