title: Bitbucket Jdk Version Mismatch Issue
body: <p>I am developing my application on Java version 1.8 and since my repository is on bitbucket, it is picking up the default configuration of Java 11.
  Everything is working fine but when I am writing <strong>Integration Tests</strong> using Junit Mockito framework I am getting exception on bitbucket while executing the pipeline. Locally all tests are working fine.</p>
  <p>Bitbucket by default is picking the latest version on sonar plugin which is 3.9 and because of that I am getting this exception</p>
  <pre><code>[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project xyz: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar: java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
  </code></pre>
  <p>I have tried following changes but nothing happened</p>
  <pre><code>1) Changed image: maven:3.6.3-jdk-11 To image: maven:3.6.3-jdk-8 in bitbucket-pipeline.yml file.
  2) Added jacoco 0.7.9 version (Java 8 compatible) in pom file
  3) Added sonar-maven-plugin version 3.6 (tried to downgrade it to be compatible with Java 8) in pom file
  </code></pre>
  <p>Can someone guide what is missing and what can be the issue. Also if I want to change the default bitucket docker image configuration how can I do that?</p>
  <p>My bitbucket-pipeline.yml file</p>
  <pre><code>image: maven:3.6.3-jdk-11   #image: maven:3.6.3-jdk-8
  clone
  ....
  definitions
    caches
       sonar: ....
    steps
    ...
    ...
    script:
       cd impl
       mvn -B org.jacoco:jacoco-maven-plugin:prepare-agent verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
  </code></pre>
  <p>My Integration Test File</p>
  <pre><code>@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
  @AutoConfigureMockMvc
  @ActiveProfiles(&quot;test&quot;)
  @RunWith(SpringRunner.class)
  public class CountryControllerTest{
     @Autowired public MockMvc mockMvc;
  
     @Test
     public void getCountryListTest() throws Exception {
        mockMvc
         .perform(MockMvcRequestBuilders.get(&quot;/api/countries&quot;))
         .andDo(print())
         .andExpect(status().isOk())
         .andExpect(jsonPath(&quot;$.data.length()&quot;).value(2))
         .andExpect(jsonPath(&quot;$.data[0].name&quot;).value(&quot;USA&quot;))
         .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE));
     }
  }
  </code></pre>
  <p>The Error is only occurring on bitbucket pipeline and not in local development</p>
  <pre><code>[ERROR] getCountryListTest(com.xyz.controller.CountryControllerTest)  Time elapsed: 0.001 s  &lt;&lt;&lt; ERROR!
  java.lang.IllegalStateException: Failed to load ApplicationContext
  Caused by: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
  Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
  Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MyTokenFilter': Unsatisfied dependency expressed through field 'myRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myRepository': Cannot create inner bean '(inner bean)#7675d305' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#12345': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myRepository': Cannot create inner bean '(inner bean)#12345' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#12345': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#12345': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
  Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
  Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
  Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
  Caused by: java.lang.reflect.InvocationTargetException
  Caused by: java.lang.NullPointerException
  </code></pre>