我在一个单片应用程序中使用了Travis并且它工作正常 .
现在,我正在分裂成微服务,Travis显示以下错误:


应用程序未能启动


描述:

无法配置DataSource:未指定'url'属性,也无法配置嵌入数据源 .

原因:无法确定合适的驱动程序类

行动:

考虑以下:

If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.

If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

我的bootstrap.properties

spring.application.name=api-client
spring.cloud.config.uri=http://localhost:8888

我的.travis.yml

language: java
jdk:
  - oraclejdk8
before_install:
  - chmod +x mvnw

sudo: enabled

addons:
  postgresql: "9.4"

before_script:
   - psql -c "create database aries;" -U postgres
   - sudo -u postgres psql -c "ALTER ROLE postgres WITH password 'postgres'"

services:
  - PostgreSQL

[错误]测试运行:1,失败:0,错误:1,跳过:0,已过去时间:7.827秒<<<失败! - 在com.rjdesenvolvimento.apipessoas.ApipessoasApplicationTests [ERROR] contextLoads(com.rjdesenvolvimento.apipessoas.ApipessoasApplicationTests)经过的时间:0.002秒<<<错误! java.lang.IllegalStateException:无法加载ApplicationContext引起:org.springframework.beans.factory.BeanCreationException:创建名为'org.springframework.cloud.autoconfigure.RefreshAutoConfiguration $ JpaInvokerConfiguration'的bean时出错:init方法的调用失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名为'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker'的bean时出错:init方法的调用失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名为'dataSource'的bean时出错:FactoryBean的单例对象的后处理失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:在类路径资源中定义名为'scopedTarget.dataSource'的bean时出错[org / springframework / boot / autoconfigure / jdbc / DataSourceConfiguration $ Hikari.class]:通过工厂进行Bean实例化方法失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[com.zaxxer.hikari.HikariDataSource]:工厂方法'dataSource'抛出异常;嵌套异常是org.springframework.boot.autoconfigure.jdbc.DataSourceProperties $ DataSourceBeanCreationException:无法确定合适的驱动程序类引起:org.springframework.beans.factory.BeanCreationException:创建名为'org.springframework.boot.autoconfigure的bean时出错.jdbc.DataSourceInitializerInvoker':init方法的调用失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名为'dataSource'的bean时出错:FactoryBean的单例对象的后处理失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:在类路径资源中定义名为'scopedTarget.dataSource'的bean时出错[org / springframework / boot / autoconfigure / jdbc / DataSourceConfiguration $ Hikari.class]:通过工厂进行Bean实例化方法失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[com.zaxxer.hikari.HikariDataSource]:工厂方法'dataSource'抛出异常;嵌套异常是org.springframework.boot.autoconfigure.jdbc.DataSourceProperties $ DataSourceBeanCreationException:无法确定合适的驱动程序类引起:org.springframework.beans.factory.BeanCreationException:创建名为'dataSource'的bean时出错:后处理FactoryBean的单例对象失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:在类路径资源中定义名为'scopedTarget.dataSource'的bean时出错[org / springframework / boot / autoconfigure / jdbc / DataSourceConfiguration $ Hikari.class]:通过工厂进行Bean实例化方法失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[com.zaxxer.hikari.HikariDataSource]:工厂方法'dataSource'抛出异常;嵌套异常是org.springframework.boot.autoconfigure.jdbc.DataSourceProperties $ DataSourceBeanCreationException:无法确定合适的驱动程序类引起:org.springframework.beans.factory.BeanCreationException:创建类名为'scopedTarget.dataSource'的bean在类中定义时出错path资源[org / springframework / boot / autoconfigure / jdbc / DataSourceConfiguration $ Hikari.class]:通过工厂方法进行Bean实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[com.zaxxer.hikari.HikariDataSource]:工厂方法'dataSource'抛出异常;嵌套异常是org.springframework.boot.autoconfigure.jdbc.DataSourceProperties $ DataSourceBeanCreationException:无法确定合适的驱动程序类引起:org.springframework.beans.BeanInstantiationException:无法实例化[com.zaxxer.hikari.HikariDataSource]:工厂方法'dataSource'抛出异常;嵌套异常是org.springframework.boot.autoconfigure.jdbc.DataSourceProperties $ DataSourceBeanCreationException:无法确定合适的驱动程序类引起的:org.springframework.boot.autoconfigure.jdbc.DataSourceProperties $ DataSourceBeanCreationException:无法确定合适的驱动程序类