From 7712b8a5df8e763367062d6ea644203c140fadc7 Mon Sep 17 00:00:00 2001 From: Marcelo Klein Date: Sat, 12 Oct 2019 15:01:07 -0300 Subject: [PATCH] Added Gradle and CircleCI --- .circleci/config.yml | 45 ++++++++++++++++++++++++++++++++ build.gradle | 61 ++++++++++++++++++++++++++++++++++++++++++++ settings.gradle | 5 ++++ 3 files changed, 111 insertions(+) create mode 100644 .circleci/config.yml create mode 100644 build.gradle create mode 100644 settings.gradle diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..5b93a2a76 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,45 @@ +# Java Gradle CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-java/ for more details +# +version: 2 +jobs: + build: + docker: + # specify the version you desire here + - image: circleci/openjdk:8-jdk + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/postgres:9.4 + + working_directory: ~/repo + + environment: + # Customize the JVM maximum heap limit + JVM_OPTS: -Xmx3200m + TERM: dumb + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "build.gradle" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: gradle dependencies + + - save_cache: + paths: + - ~/.gradle + key: v1-dependencies-{{ checksum "build.gradle" }} + + # run tests! + - run: gradle test + + #generate jar + - jar: gradle jar diff --git a/build.gradle b/build.gradle new file mode 100644 index 000000000..7be364cd8 --- /dev/null +++ b/build.gradle @@ -0,0 +1,61 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + id 'java' + id 'maven-publish' + id 'org.springframework.boot' version '2.1.9.RELEASE' +} + +repositories { + mavenLocal() + maven { + url = 'https://repo.spring.io/snapshot' + } + + maven { + url = 'https://repo.spring.io/milestone' + } + + maven { + url = 'http://repo.maven.apache.org/maven2' + } +} + +dependencies { + compile 'org.springframework.boot:spring-boot-starter-actuator:2.1.9.RELEASE' + compile 'org.springframework.boot:spring-boot-starter-cache:2.1.9.RELEASE' + compile 'org.springframework.boot:spring-boot-starter-data-jpa:2.1.9.RELEASE' + compile 'org.springframework.boot:spring-boot-starter-web:2.1.9.RELEASE' + compile 'org.springframework.boot:spring-boot-starter-thymeleaf:2.1.9.RELEASE' + compile 'javax.cache:cache-api:1.1.1' + compile 'org.ehcache:ehcache:3.6.3' + compile 'org.webjars:webjars-locator-core:0.35' + compile 'org.webjars:jquery:2.2.4' + compile 'org.webjars:jquery-ui:1.11.4' + compile 'org.webjars:bootstrap:3.3.6' + compile 'org.springframework.boot:spring-boot-devtools:2.1.9.RELEASE' + runtime 'org.hsqldb:hsqldb:2.4.1' + runtime 'mysql:mysql-connector-java:8.0.17' + testCompile 'org.springframework.boot:spring-boot-starter-test:2.1.9.RELEASE' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' +} + +group = 'org.springframework.samples' +version = '2.1.0.BUILD-SNAPSHOT' +description = 'petclinic' +sourceCompatibility = '1.8' + +publishing { + publications { + maven(MavenPublication) { + from(components.java) + } + } +} + +tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' +} diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 000000000..5b68bbdfe --- /dev/null +++ b/settings.gradle @@ -0,0 +1,5 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +rootProject.name = 'spring-petclinic'