Jag löste mitt problem genom att ändra basvägen. Det fungerar bra.
Min andra klass,
@ConditionalOnProperty(name = "embedded", havingValue = "true", matchIfMissing = true)
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(entityManagerFactoryRef = "dataSyncEntityManagerFactory", transactionManagerRef = "dataSyncTransactionManager", basePackages = {
"kgfsl.rms.datasync" })
public class JPADataSyncConfig {