diff --git a/.travis.yml b/.travis.yml index 10ce67e89..4957b38a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,20 @@ language: java jdk: oraclejdk8 services: - mysql -install: - - ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V +cache: + directories: + - "$HOME/.m2" +before_cache: + - rm -rf $HOME/.m2/repository/com/autentia/traviscodacy before_install: -- chmod +x mvnw -- mysql -e 'CREATE DATABASE cheapy;' -- sudo apt-get update -script: - - mvn test -Dspring.profiles.active=mysql-travis + - sudo apt-get install jq + - wget -O ~/codacy-coverage-reporter-assembly-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url) + - chmod +x mvnw + - mysql -e 'CREATE DATABASE cheapy;' + - sudo apt-get update +after_success: + - ls + - ls target + - ls target/jacoco + - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/jacoco/jacoco.xml diff --git a/pom.xml b/pom.xml index c0ab78aad..eacae383f 100644 --- a/pom.xml +++ b/pom.xml @@ -28,6 +28,11 @@ 1.8.0 0.8.5 + ${project.build.directory}/jacoco + ${project.build.directory}/jacoco.exec + + ${project.build.directory}/jacoco + ${jacoco.itreportpath}/jacoco-it.exec 0.0.4.RELEASE 0.0.25 @@ -140,7 +145,11 @@ spring-boot-devtools true - + + org.postgresql + postgresql + runtime + @@ -178,6 +187,7 @@ prepare-agent + report @@ -185,6 +195,21 @@ report + + ${jacoco.utreportpath} + ${jacoco.utreportfile} + + + + test + test + + report + + + ${jacoco.utreportpath} + ${jacoco.utreportfile} + diff --git a/src/main/resources/application-mysql.properties b/src/main/resources/application-mysql.properties index ccc6807c3..a2a4c4998 100644 --- a/src/main/resources/application-mysql.properties +++ b/src/main/resources/application-mysql.properties @@ -1,12 +1,11 @@ # database init, supports mysql too database=mysql -spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/cheapy?serverTimezone=UTC} +#spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/cheapy?serverTimezone=UTC} spring.datasource.username=${MYSQL_USER:cheapy} spring.datasource.password=${MYSQL_PASS:cheapy} # SQL is written to be idempotent so this is safe spring.datasource.initialization-mode=always -spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy spring.jpa.properties.javax.persistence.schema-generation.drop-source=metadata # Naming strategy spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 97ef60ff4..afee236bf 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -4,6 +4,8 @@ database=mysql spring.datasource.data=classpath*:db/${database}/data.sql spring.h2.console.enabled=true spring.profiles.active=mysql +spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/cheapy?serverTimezone=UTC} +spring.datasource.driver-class-name=org.postgresql.Driver # Web spring.thymeleaf.mode=HTML