title: Exception in Spring JUnit 5 test
body: <p>I have the following simple class </p>
  
  <pre><code>@Service
  public class HearingInterpreter {
  
      private final WordProducer wordProducer;
  
      public HearingInterpreter(WordProducer wordProducer) {
          this.wordProducer = wordProducer;
      }
  
      public String whatIheard() {
          String word = wordProducer.getWord();
  
          System.out.println(word);
  
          return word;
      }
  }
  </code></pre>
  
  <p>And the following configuration files</p>
  
  <pre><code>@Configuration
  public class BaseConfig {
  
      @Bean
      HearingInterpreter hearingInterpreter(WordProducer wordProducer) {
          return new HearingInterpreter(wordProducer);
      }
  }
  
  @Configuration
  public class LaurelConfig {
  
      @Bean
      LaurelWordProducer laurelWordProducer() {
          return new LaurelWordProducer();
      }
  
  }
  </code></pre>
  
  <p>I wrote the following JUnit 5 based test class </p>
  
  <pre><code>@SpringJUnitConfig(classes = {BaseConfig.class, LaurelConfig.class})
  class HearingInterpreterTest {
  
      @Autowired
      HearingInterpreter hearingInterpreter;
  
      @Test
      void whatIheard() {
          String word = hearingInterpreter.whatIheard();
  
          assertEquals("Laurel", word);
      }
  
  }
  </code></pre>
  
  <p>When I run the test, I get the following error(s)</p>
  
  <p>java.lang.NoClassDefFoundError: org/springframework/core/annotation/MergedAnnotations$SearchStrategy</p>
  
  <pre><code>at org.springframework.test.context.support.TestPropertySourceUtils.buildMergedTestPropertySources(TestPropertySourceUtils.java:74)
  at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:386)
  at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:294)
  at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:108)
  at org.springframework.test.context.TestContextManager.&lt;init&gt;(TestContextManager.java:137)
  at org.springframework.test.context.TestContextManager.&lt;init&gt;(TestContextManager.java:122)
  at org.junit.jupiter.engine.execution.ExtensionValuesStore.lambda$getOrComputeIfAbsent$0(ExtensionValuesStore.java:80)
  at org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.get(ExtensionValuesStore.java:185)
  at org.junit.jupiter.engine.execution.ExtensionValuesStore.getOrComputeIfAbsent(ExtensionValuesStore.java:87)
  at org.junit.jupiter.engine.execution.ExtensionValuesStore.getOrComputeIfAbsent(ExtensionValuesStore.java:91)
  at org.junit.jupiter.engine.execution.NamespaceAwareStore.getOrComputeIfAbsent(NamespaceAwareStore.java:61)
  at org.springframework.test.context.junit.jupiter.SpringExtension.getTestContextManager(SpringExtension.java:213)
  at org.springframework.test.context.junit.jupiter.SpringExtension.beforeAll(SpringExtension.java:77)
  at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeBeforeAllCallbacks$7(ClassTestDescriptor.java:358)
  at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
  at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeBeforeAllCallbacks(ClassTestDescriptor.java:358)
  at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.before(ClassTestDescriptor.java:197)
  at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.before(ClassTestDescriptor.java:74)
  at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$4(NodeTestTask.java:105)
  at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
  at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:98)
  at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)
  at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
  at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
  at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$4(NodeTestTask.java:112)
  at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
  at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:98)
  at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)
  at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
  at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
  at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
  at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
  at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
  at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
  at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
  at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
  at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:69)
  at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
  at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
  at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
  Suppressed: java.lang.NoClassDefFoundError: org/springframework/core/annotation/MergedAnnotations$SearchStrategy
      at org.springframework.test.context.support.TestPropertySourceUtils.buildMergedTestPropertySources(TestPropertySourceUtils.java:74)
      at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:386)
      at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:294)
      at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:108)
      at org.springframework.test.context.TestContextManager.&lt;init&gt;(TestContextManager.java:137)
      at org.springframework.test.context.TestContextManager.&lt;init&gt;(TestContextManager.java:122)
      at org.junit.jupiter.engine.execution.ExtensionValuesStore.lambda$getOrComputeIfAbsent$0(ExtensionValuesStore.java:80)
      at org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.get(ExtensionValuesStore.java:185)
      at org.junit.jupiter.engine.execution.ExtensionValuesStore.remove(ExtensionValuesStore.java:101)
      at org.junit.jupiter.engine.execution.NamespaceAwareStore.remove(NamespaceAwareStore.java:73)
      at org.springframework.test.context.junit.jupiter.SpringExtension.afterAll(SpringExtension.java:89)
      at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeAfterAllCallbacks$11(ClassTestDescriptor.java:396)
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
      at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeAfterAllCallbacks$12(ClassTestDescriptor.java:396)
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
      at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeAfterAllCallbacks(ClassTestDescriptor.java:396)
      at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.after(ClassTestDescriptor.java:221)
      at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.after(ClassTestDescriptor.java:74)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:118)
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:118)
      ... 19 more
  </code></pre>
  
  <p>Caused by: java.lang.ClassNotFoundException: org.springframework.core.annotation.MergedAnnotations$SearchStrategy
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      ... 40 more</p>
  
  <p>My pom file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;guru.springframework.petclinic&lt;/groupId&gt;
      &lt;artifactId&gt;tb2g-testing-spring&lt;/artifactId&gt;
      &lt;version&gt;5.1.0&lt;/version&gt;
  
      &lt;name&gt;tb2g-testing-spring&lt;/name&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;description&gt;*** FORK FROM ORIGINAL SPRING PROJECT TO DEMO TESTING FEATURES OF SPRING *** A Spring Framework application based on JSP, Spring MVC, Spring Data JPA, Hibernate and JDBC&lt;/description&gt;
      &lt;url&gt;https://github.com/spring-petclinic/&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;!-- Generic properties --&gt;
          &lt;java.version&gt;11&lt;/java.version&gt;
          &lt;maven.compiler.source&gt;${java.version}&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;${java.version}&lt;/maven.compiler.target&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
  
          &lt;!-- Spring --&gt;
          &lt;spring-framework.version&gt;5.1.4.RELEASE&lt;/spring-framework.version&gt;
          &lt;spring-data-jdbc.version&gt;2.0.0.M1&lt;/spring-data-jdbc.version&gt;
  
          &lt;!-- Web dependencies --&gt;
          &lt;!-- Version update should also be done in wro.xml, petclinic.less and static resources: htmlHeader.tag and footer.tag--&gt;
          &lt;webjars-bootstrap.version&gt;3.4.0&lt;/webjars-bootstrap.version&gt;
          &lt;webjars-jquery-ui.version&gt;1.11.4&lt;/webjars-jquery-ui.version&gt;
          &lt;webjars-jquery.version&gt;2.2.4&lt;/webjars-jquery.version&gt;
          &lt;wro4j.version&gt;1.8.0&lt;/wro4j.version&gt;
  
          &lt;!-- Java EE / Java SE dependencies --&gt;
          &lt;tomcat.version&gt;9.0.14&lt;/tomcat.version&gt;
          &lt;jaxb.version&gt;2.3.0&lt;/jaxb.version&gt;
          &lt;activation.version&gt;1.1.1&lt;/activation.version&gt;
          &lt;servlet-api.version&gt;4.0.1&lt;/servlet-api.version&gt;
          &lt;javax-jstl.version&gt;1.2.2&lt;/javax-jstl.version&gt;
          &lt;taglibs-standard.version&gt;1.2.5&lt;/taglibs-standard.version&gt;
  
          &lt;!-- Persistence --&gt;
          &lt;spring-data-releasetrain.version&gt;Lovelace-RELEASE&lt;/spring-data-releasetrain.version&gt;
          &lt;hibernate.version&gt;5.4.1.Final&lt;/hibernate.version&gt;
          &lt;hibernate-validator.version&gt;6.0.14.Final&lt;/hibernate-validator.version&gt;
          &lt;hsqldb.version&gt;2.4.1&lt;/hsqldb.version&gt;
  
          &lt;!-- Logging --&gt;
          &lt;slf4j.version&gt;1.7.25&lt;/slf4j.version&gt;
          &lt;logback.version&gt;1.2.3&lt;/logback.version&gt;
  
          &lt;!-- Test --&gt;
          &lt;assertj.version&gt;3.11.1&lt;/assertj.version&gt;
          &lt;json-path.version&gt;2.4.0&lt;/json-path.version&gt;
          &lt;mockito.version&gt;2.23.4&lt;/mockito.version&gt;
          &lt;hamcrest.version&gt;1.3&lt;/hamcrest.version&gt;
          &lt;junit-jupiter.version&gt;5.3.2&lt;/junit-jupiter.version&gt;
  
          &lt;!-- Others --&gt;
          &lt;jackson.version&gt;2.9.8&lt;/jackson.version&gt;
          &lt;aspectj.version&gt;1.9.1&lt;/aspectj.version&gt;
  
          &lt;!-- Maven plugins --&gt;
          &lt;jetty-maven-plugin.version&gt;9.4.14.v20181114&lt;/jetty-maven-plugin.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.fasterxml.jackson&lt;/groupId&gt;
                  &lt;artifactId&gt;jackson-bom&lt;/artifactId&gt;
                  &lt;version&gt;${jackson.version}&lt;/version&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
                  &lt;type&gt;pom&lt;/type&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-data-releasetrain&lt;/artifactId&gt;
                  &lt;version&gt;${spring-data-releasetrain.version}&lt;/version&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
                  &lt;type&gt;pom&lt;/type&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat-servlet-api&lt;/artifactId&gt;
              &lt;version&gt;${tomcat.version}&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat-jasper-el&lt;/artifactId&gt;
              &lt;version&gt;${tomcat.version}&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet.jsp.jstl&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet.jsp.jstl-api&lt;/artifactId&gt;
              &lt;version&gt;${javax-jstl.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.taglibs&lt;/groupId&gt;
              &lt;artifactId&gt;taglibs-standard-jstlel&lt;/artifactId&gt;
              &lt;version&gt;${taglibs-standard.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!--  JSon --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.jayway.jsonpath&lt;/groupId&gt;
              &lt;artifactId&gt;json-path&lt;/artifactId&gt;
              &lt;version&gt;${json-path.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- SPRING, SPRING, SPRINGITY SPRING --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-jdbc-core&lt;/artifactId&gt;
              &lt;version&gt;1.2.1.RELEASE&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                      &lt;artifactId&gt;*&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;!--  because Spring Data usually comes with a slightly older version of Spring --&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
              &lt;version&gt;${spring-framework.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${spring-framework.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- used for EhCacheCacheManager --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context-support&lt;/artifactId&gt;
              &lt;version&gt;${spring-framework.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-oxm&lt;/artifactId&gt;
              &lt;version&gt;${spring-framework.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
              &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
              &lt;version&gt;${aspectj.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
              &lt;artifactId&gt;aspectjweaver&lt;/artifactId&gt;
              &lt;version&gt;${aspectj.version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Database connection pool
          See here for more details on commons-dbcp versus tomcat-jdbc:
          http://blog.ippon.fr/2013/03/13/improving-the-performance-of-the-spring-petclinic-sample-application-part-3-of-5/
      --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat-jdbc&lt;/artifactId&gt;
              &lt;version&gt;${tomcat.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Logging with SLF4J &amp; LogBack --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;${slf4j.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
              &lt;version&gt;${logback.version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- HIBERNATE --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
              &lt;version&gt;${hibernate.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.validator&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
              &lt;version&gt;${hibernate-validator.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-ehcache&lt;/artifactId&gt;
              &lt;version&gt;${hibernate.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!--Java 11 support--&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
              &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
              &lt;version&gt;${jaxb.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.xml.bind&lt;/groupId&gt;
              &lt;artifactId&gt;jaxb-core&lt;/artifactId&gt;
              &lt;version&gt;${jaxb.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.xml.bind&lt;/groupId&gt;
              &lt;artifactId&gt;jaxb-impl&lt;/artifactId&gt;
              &lt;version&gt;${jaxb.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.activation&lt;/groupId&gt;
              &lt;artifactId&gt;activation&lt;/artifactId&gt;
              &lt;version&gt;${activation.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.annotation&lt;/groupId&gt;
              &lt;artifactId&gt;javax.annotation-api&lt;/artifactId&gt;
              &lt;version&gt;1.3.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Webjars --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.webjars&lt;/groupId&gt;
              &lt;artifactId&gt;jquery&lt;/artifactId&gt;
              &lt;version&gt;${webjars-jquery.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.webjars&lt;/groupId&gt;
              &lt;artifactId&gt;jquery-ui&lt;/artifactId&gt;
              &lt;version&gt;${webjars-jquery-ui.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.webjars&lt;/groupId&gt;
              &lt;artifactId&gt;bootstrap&lt;/artifactId&gt;
              &lt;version&gt;${webjars-bootstrap.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Test Artifacts --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
              &lt;version&gt;${spring-framework.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&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;${junit-jupiter.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.vintage&lt;/groupId&gt;
              &lt;artifactId&gt;junit-vintage-engine&lt;/artifactId&gt;
              &lt;version&gt;${junit-jupiter.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.assertj&lt;/groupId&gt;
              &lt;artifactId&gt;assertj-core&lt;/artifactId&gt;
              &lt;version&gt;${assertj.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
              &lt;version&gt;${mockito.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-junit-jupiter&lt;/artifactId&gt;
              &lt;version&gt;${mockito.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
              &lt;artifactId&gt;hamcrest-all&lt;/artifactId&gt;
              &lt;version&gt;${hamcrest.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
              &lt;version&gt;5.2.4.RELEASE&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
      &lt;!-- Maven plugin versions are mentioned in order to guarantee the build reproducibility in the long term --&gt;
      &lt;build&gt;
          &lt;defaultGoal&gt;install&lt;/defaultGoal&gt;
          &lt;finalName&gt;petclinic&lt;/finalName&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;${basedir}/src/main/resources&lt;/directory&gt;
                  &lt;filtering&gt;true&lt;/filtering&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
          &lt;testResources&gt;
              &lt;testResource&gt;
                  &lt;!-- declared explicitly so Spring config files can be placed next to their corresponding JUnit test class  --&gt;
                  &lt;directory&gt;${project.basedir}/src/test/java&lt;/directory&gt;
              &lt;/testResource&gt;
              &lt;testResource&gt;
                  &lt;directory&gt;${project.basedir}/src/test/resources&lt;/directory&gt;
              &lt;/testResource&gt;
          &lt;/testResources&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.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;compilerArguments&gt;
                          &lt;Xlint/&gt;
                      &lt;/compilerArguments&gt;
                      &lt;verbose&gt;true&lt;/verbose&gt;
                      &lt;source&gt;${java.version}&lt;/source&gt;
                      &lt;target&gt;${java.version}&lt;/target&gt;
                      &lt;showWarnings&gt;true&lt;/showWarnings&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;2.22.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;includes&gt;
                          &lt;include&gt;**/*Tests.java&lt;/include&gt;
                      &lt;/includes&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.2.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;descriptorRefs&gt;
                          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                      &lt;/descriptorRefs&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;!--Specify the encoding for copying resources--&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;ro.isdc.wro4j&lt;/groupId&gt;
                  &lt;artifactId&gt;wro4j-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${wro4j.version}&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;generate-resources&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;run&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;wroManagerFactory&gt;ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory&lt;/wroManagerFactory&gt;
                      &lt;cssDestinationFolder&gt;${project.build.directory}/petclinic/resources/css&lt;/cssDestinationFolder&gt;
                      &lt;wroFile&gt;${basedir}/src/main/wro/wro.xml&lt;/wroFile&gt;
                      &lt;extraConfigFile&gt;${basedir}/src/main/wro/wro.properties&lt;/extraConfigFile&gt;
                      &lt;contextFolder&gt;${basedir}/src/main/webapp/resources/less&lt;/contextFolder&gt;
                  &lt;/configuration&gt;
                  &lt;dependencies&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.webjars&lt;/groupId&gt;
                          &lt;artifactId&gt;bootstrap&lt;/artifactId&gt;
                          &lt;version&gt;${webjars-bootstrap.version}&lt;/version&gt;
                      &lt;/dependency&gt;
                      &lt;!--Needed for Java 11--&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.mockito&lt;/groupId&gt;
                          &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;
                          &lt;version&gt;${mockito.version}&lt;/version&gt;
                      &lt;/dependency&gt;
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
                  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${jetty-maven-plugin.version}&lt;/version&gt;
              &lt;/plugin&gt;
  
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;HSQLDB&lt;/id&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;properties&gt;
                  &lt;db.script&gt;hsqldb&lt;/db.script&gt;
                  &lt;jpa.database&gt;HSQL&lt;/jpa.database&gt;
                  &lt;jdbc.driverClassName&gt;org.hsqldb.jdbcDriver&lt;/jdbc.driverClassName&gt;
                  &lt;jdbc.url&gt;jdbc:hsqldb:mem:petclinic&lt;/jdbc.url&gt;
                  &lt;jdbc.username&gt;sa&lt;/jdbc.username&gt;
                  &lt;jdbc.password/&gt;
              &lt;/properties&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.hsqldb&lt;/groupId&gt;
                      &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
                      &lt;version&gt;${hsqldb.version}&lt;/version&gt;
                      &lt;scope&gt;runtime&lt;/scope&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;repository.spring.milestone&lt;/id&gt;
              &lt;name&gt;Spring Milestone Repository&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
  &lt;/project&gt;
  </code></pre>