|
| 1 | +buildscript { |
| 2 | + |
| 3 | + ext { |
| 4 | + kotlinVersion = '1.3.41' |
| 5 | + springBootVersion = '2.1.6.RELEASE' |
| 6 | + cxfVersion = '3.3.2' |
| 7 | + oidcTokenSupportVersion = '0.2.9' |
| 8 | + logstashLogbackVersion = '6.1' |
| 9 | + pensjonInformasjonVersion = '9.4.10' |
| 10 | + personV3Version = '3.6.1' |
| 11 | + } |
| 12 | + repositories { |
| 13 | + maven { |
| 14 | + url "https://plugins.gradle.org/m2/" |
| 15 | + } |
| 16 | + maven { |
| 17 | + url "https://repo.adeo.no/repository/maven-central" |
| 18 | + } |
| 19 | + } |
| 20 | + |
| 21 | + dependencies { |
| 22 | + classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") |
| 23 | + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}") |
| 24 | + classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}") |
| 25 | + classpath("gradle.plugin.org.openrepose:gradle-jaxb-plugin:2.5.0") |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +plugins { |
| 30 | + id 'se.patrikerdes.use-latest-versions' version '0.2.12' |
| 31 | + id 'com.github.ben-manes.versions' version '0.21.0' |
| 32 | + id "org.owasp.dependencycheck" version "5.2.0" |
| 33 | + id "org.sonarqube" version "2.7.1" |
| 34 | + id 'jacoco' |
| 35 | +} |
| 36 | + |
| 37 | +apply plugin: 'kotlin' |
| 38 | +apply plugin: 'kotlin-spring' |
| 39 | +apply plugin: 'org.springframework.boot' |
| 40 | +apply plugin: 'io.spring.dependency-management' |
| 41 | +apply plugin: 'org.openrepose.gradle.plugins.jaxb' |
| 42 | + |
| 43 | +group = 'no.nav.eessi.pensjon' |
| 44 | +version = '0.0.1-SNAPSHOT' |
| 45 | + |
| 46 | +configurations { |
| 47 | + xsd |
| 48 | +} |
| 49 | + |
| 50 | +dependencies { |
| 51 | + |
| 52 | + // Spring-boot |
| 53 | + implementation("org.springframework.boot:spring-boot-starter-aop") |
| 54 | + implementation("org.springframework.boot:spring-boot-starter-web") |
| 55 | + implementation("org.springframework.boot:spring-boot-starter-actuator") |
| 56 | + implementation("org.springframework.boot:spring-boot-actuator") |
| 57 | + |
| 58 | + implementation 'com.fasterxml.jackson.module:jackson-module-kotlin' |
| 59 | + implementation 'org.jetbrains.kotlin:kotlin-reflect' |
| 60 | + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' |
| 61 | + implementation 'org.springframework.kafka:spring-kafka' |
| 62 | + testImplementation('org.springframework.boot:spring-boot-starter-test') { |
| 63 | + exclude module: 'junit' |
| 64 | + exclude module: "mockito-core" |
| 65 | + } |
| 66 | + testImplementation 'org.springframework.kafka:spring-kafka-test' |
| 67 | + testCompileOnly('junit:junit:4.12') { |
| 68 | + because "spring-kafka-test needs it - but we should not use it in our code" |
| 69 | + } |
| 70 | + |
| 71 | + // OIDC |
| 72 | + implementation("no.nav.security:oidc-spring-support:0.2.18") |
| 73 | + implementation("no.nav.security:oidc-test-support:0.2.18") |
| 74 | + |
| 75 | + // Apache CXF |
| 76 | + implementation("org.apache.cxf:cxf-spring-boot-starter-jaxws:${cxfVersion}") |
| 77 | + implementation("org.apache.cxf:cxf-rt-ws-security:${cxfVersion}") |
| 78 | + implementation("commons-io:commons-io:2.6") |
| 79 | + |
| 80 | + // Allows for variable expiration-date of each cache-entry |
| 81 | + implementation("net.jodah:expiringmap:0.5.9") |
| 82 | + |
| 83 | + //mock - test |
| 84 | + testImplementation("org.junit.jupiter:junit-jupiter:5.5.1") |
| 85 | + testImplementation("org.junit.jupiter:junit-jupiter-params:5.5.1") |
| 86 | + testImplementation('org.mockito:mockito-junit-jupiter:2.23.0') |
| 87 | + testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0") |
| 88 | + testImplementation("org.mock-server:mockserver-netty:5.4.1") { |
| 89 | + exclude module: 'junit' |
| 90 | + } |
| 91 | + testImplementation("org.mock-server:mockserver-client-java:5.4.1") |
| 92 | + testImplementation "io.mockk:mockk:1.9.2" |
| 93 | + |
| 94 | + // Architecture tests |
| 95 | + testImplementation 'com.tngtech.archunit:archunit:0.11.0' |
| 96 | + |
| 97 | + // Micrometer |
| 98 | + implementation("io.micrometer:micrometer-registry-prometheus") |
| 99 | + |
| 100 | + // Tjenestespesifikasjoner |
| 101 | + implementation("no.nav.tjenester:nav-person-v3-tjenestespesifikasjon:${personV3Version}") |
| 102 | + xsd("no.nav.pensjon:pensjonsinformasjon-xsd:${pensjonInformasjonVersion}") |
| 103 | + |
| 104 | + // PDF box |
| 105 | + implementation("org.apache.pdfbox:pdfbox-tools:2.0.13") |
| 106 | + implementation("com.twelvemonkeys.imageio:imageio-jpeg:3.1.1") |
| 107 | + implementation("com.twelvemonkeys.imageio:imageio-tiff:3.1.1") |
| 108 | + |
| 109 | + // Logging |
| 110 | + implementation("net.logstash.logback:logstash-logback-encoder:${logstashLogbackVersion}") |
| 111 | + configurations { all*.exclude group: 'commons-logging', module: 'commons-logging' } |
| 112 | + implementation group: 'org.slf4j', name: 'jcl-over-slf4j' |
| 113 | + |
| 114 | +} |
| 115 | + |
| 116 | +test { |
| 117 | + useJUnitPlatform() |
| 118 | +} |
| 119 | + |
| 120 | +compileKotlin { |
| 121 | + kotlinOptions { |
| 122 | + freeCompilerArgs = ["-Xjsr305=strict"] |
| 123 | + jvmTarget = "1.8" |
| 124 | + } |
| 125 | +} |
| 126 | + |
| 127 | +compileTestKotlin { |
| 128 | + kotlinOptions { |
| 129 | + freeCompilerArgs = ['-Xjsr305=strict'] |
| 130 | + jvmTarget = '1.8' |
| 131 | + } |
| 132 | +} |
| 133 | + |
| 134 | +repositories { |
| 135 | + maven { |
| 136 | + url "https://repo.adeo.no/repository/maven-central" |
| 137 | + } |
| 138 | + maven { |
| 139 | + url "https://repo.adeo.no/repository/maven-releases" |
| 140 | + } |
| 141 | +} |
| 142 | + |
| 143 | +wrapper { |
| 144 | + distributionType = Wrapper.DistributionType.ALL |
| 145 | +} |
| 146 | + |
| 147 | +// https://docs.gradle.org/current/userguide/jacoco_plugin.html |
| 148 | +jacoco { |
| 149 | + toolVersion = "0.8.4" |
| 150 | +} |
| 151 | + |
| 152 | +jacocoTestReport { |
| 153 | + reports { |
| 154 | + xml.enabled true |
| 155 | + } |
| 156 | +} |
| 157 | + |
| 158 | +tasks.sonarqube.dependsOn jacocoTestReport |
| 159 | + |
| 160 | +/* https://github.com/ben-manes/gradle-versions-plugin */ |
| 161 | +dependencyUpdates { |
| 162 | + resolutionStrategy() { |
| 163 | + componentSelection { rules -> |
| 164 | + rules.all { ComponentSelection selection -> |
| 165 | + boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'pr'].any { qualifier -> |
| 166 | + selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/ |
| 167 | + } |
| 168 | + if (rejected) { |
| 169 | + selection.reject('Not a real release') |
| 170 | + } |
| 171 | + } |
| 172 | + } |
| 173 | + } |
| 174 | + revision = 'release' |
| 175 | +} |
0 commit comments