import org.gradle.kotlin.dsl.support.gradleApiMetadataFrom
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val privateToken: String by project
plugins {
id("org.springframework.boot") version "2.4.5"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
id("org.flywaydb.flyway") version "7.8.1"
kotlin("jvm") version "1.4.32"
kotlin("plugin.spring") version "1.4.32"
kotlin("plugin.jpa") version "1.4.32"
kotlin("plugin.allopen") version "1.4.32"
kotlin("plugin.noarg") version "1.4.32"
`java-library`
`maven-publish`
}
group = "cloud.honeydue"
version = "1.0.0-SNAPSHOT"
publishing {
repositories {
maven {
name = "GitLabRegistry"
url = uri("https://gitlab.com/api/v4/projects/31772427/packages/maven")
// credentials(HttpHeaderCredentials::class) {
// name = "Private-Token"
// value = "glpat-J3e_CFucgiyVqy-zjUQV"
// }
credentials(HttpHeaderCredentials::class) {
name = "Job-Token"
value = System.getenv("CI_JOB_TOKEN")
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}
publications {
create<MavenPublication>("maven") {
artifact(tasks["bootJar"])
}
}
}
java.sourceCompatibility = JavaVersion.VERSION_11
repositories {
mavenCentral()
}
tasks.jar {
manifest {
attributes(mapOf("Implementation-Title" to project.name,
"Implementation-Version" to project.version))
}
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.flywaydb:flyway-core")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-allopen")
implementation("org.jetbrains.kotlin:kotlin-noarg")
implementation("io.jsonwebtoken:jjwt-api:0.11.2")
implementation("io.jsonwebtoken:jjwt-impl:0.11.2")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.11.2")
// Uncomment the next line if you want to use RSASSA-PSS (PS256, PS384, PS512) algorithms:
runtimeOnly("org.bouncycastle:bcprov-jdk15on:1.68")
developmentOnly("org.springframework.boot:spring-boot-devtools")
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
runtimeOnly("org.postgresql:postgresql")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
}
flyway {
url = "jdbc:postgresql://localhost:5432/honeydue"
user = "postgres"
password = "cockp1t"
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}