diff --git a/build.gradle b/build.gradle index 3bef962..78de16a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,34 +1,292 @@ -apply plugin: 'java' -apply plugin: 'maven-publish' +import org.gradle.internal.os.OperatingSystem -group = 'com.github.jitpack' -version = '2.0' +plugins { + id "java" + id "maven-publish" + id "jacoco" + id "org.springframework.boot" version "2.5.13" + id 'io.spring.dependency-management' version '1.0.11.RELEASE' + id "org.sonarqube" version "3.3" +} + +apply from: 'gradle/jacoco.gradle' -sourceCompatibility = 1.8 // java 8 -targetCompatibility = 1.8 +group = "com.sloan.communication" +version = "0.0.1-SNAPSHOT" +description = "" -repositories { - mavenCentral() +publishing { + publications { + myPublication(MavenPublication) { + groupId 'com.sloan.communication' + artifactId '1' + version '0.0.1-SNAPSHOT' + artifact("build/libs/sloan-communication-service-0.0.1-SNAPSHOT.jar") + } + } + repositories { + maven { + url 'https://pkgs.dev.azure.com/versana/_packaging/Versana/maven/v1' + name 'Versana' + credentials { + username "versanaartifacts" + password System.getenv("AZURE_ARTIFACTS_ENV_ACCESS_TOKEN_VERSANA") + } + } + } } -dependencies { - implementation 'com.google.guava:guava:29.0-jre' +sourceCompatibility = 11 +targetCompatibility = 11 +assert System.properties["java.specification.version"] == "1.8" || "11" || "12" || "13" + +apply from: "gradle/sonar.gradle" + +if (OperatingSystem.current().isWindows()) { + task classpathJar(type: Jar) { + inputs.files sourceSets.main.runtimeClasspath + + archiveName = "runboot-classpath.jar" + doFirst { + manifest { + def classpath = sourceSets.main.runtimeClasspath.files + attributes "Class-Path": classpath.collect { f -> f.toURI().toString() }.join(" ") + } + } + } + + bootRun { + classpath = classpathJar.outputs.files + } } -java { - withSourcesJar() - withJavadocJar() +defaultTasks "bootRun" + +springBoot { + mainClassName = "com.sloan.communication.SloanCommunicationServiceApp" } -publishing { - publications { - maven(MavenPublication) { - from components.java - } +test { + useJUnitPlatform() + testLogging { + events 'FAILED', 'SKIPPED' + } + reports.html.enabled = false +} + +if (!project.hasProperty("runList")) { + project.ext.runList = "main" +} + +//configurations { +// providedRuntime +// implementation.exclude module: "spring-boot-starter-tomcat" +//} + +ext { + ver = [ + snakeyaml: '1.32' + ] +} + +dependencies { +// implementation group: "io.github.jhipster", name: "jhipster-framework" + implementation platform("io.github.jhipster:jhipster-dependencies:${jhipster_dependencies_version}"){ + exclude group: "com.fasterxml.jackson.core", module: "jackson-databind" + exclude group: "org.springframework.boot" + exclude group: "org.springframework.security" + exclude group: "org.springframework.cloud" + exclude group: "org.yaml", module: "snakeyaml" + exclude group: 'org.springframework.data', module: 'spring-data-mongodb' + exclude group: "org.springframework", module: "spring-webmvc" + exclude group: "com.google.guava", module: "guava" } + implementation 'org.springframework.data:spring-data-mongodb:3.3.5' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.4.2' + implementation 'com.fasterxml.jackson.core:jackson-core:2.14.0' + implementation(group: 'com.ey.nexus.avro', name: 'mod-nexus-common-avro', version: '1.0.16'){ + exclude group: "org.yaml", module: "snakeyaml" + exclude group: "com.fasterxml.jackson.core", module: "jackson-databind" + } + implementation "javax.validation:validation-api" + implementation 'org.projectlombok:lombok:1.18.22' + implementation(group: 'com.sloan', name: 'sloan_event_payload_models_thin', version: '0.0.16.14-RELEASE') + implementation group: 'com.sloan.core', name: 'sloan-sb-logging-utility', version: '1.05' +// implementation(group: 'com.sloan.kvutility', name: 'sloankeyvaultUtility', version: '0.0.3-SNAPSHOT') + implementation 'com.fasterxml.woodstox:woodstox-core:6.4.0' + implementation (group: 'org.yaml', name: 'snakeyaml', version: ver.snakeyaml) + implementation group: 'com.sloan.mikeyvault', name:'sloanmikeyvault', version: '0.0.7-RELEASE' + implementation (group: 'com.microsoft.azure', name:'azure-keyvault', version: '1.2.6') { + exclude group: "com.google.guava", module: "guava" + exclude group: "com.squareup.okio", module: "okio" + } + implementation group: 'com.squareup.okio', name: 'okio', version: '3.4.0' + implementation group: 'com.google.guava', name: 'guava', version: '32.0.1-jre' + implementation (group: 'com.azure', name:'azure-identity', version: '1.5.5') { + exclude group: "net.minidev", module: "json-smart" + exclude group: 'com.nimbusds', module: 'nimbus-jose-jwt' + } + implementation(group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: '9.31') { + exclude group: 'net.minidev', module: 'json-smart' + } + implementation group: 'com.microsoft.azure', name: 'azure', version: '1.41.2' + implementation "org.springframework.security:spring-security-web:5.7.8" + implementation group: 'io.netty', name:'netty-common', version: '4.1.85.Final' + implementation (group: 'com.azure', name:'azure-security-keyvault-secrets', version: '4.5.2'){ + exclude group: "io.netty", module: "netty-common" + } + implementation(group: 'com.sloan.core', name: 'sloan-exception-lib-thin', version: '0.0.2-RELEASE') + implementation ("org.springframework.boot:spring-boot-starter-cache"){ + exclude group: "org.yaml", module: "snakeyaml" + } + implementation "io.dropwizard.metrics:metrics-core" + implementation "io.micrometer:micrometer-registry-prometheus" + implementation ("net.logstash.logback:logstash-logback-encoder"){ + exclude group: "com.fasterxml.jackson.core", module: "jackson-databind" + } + implementation "com.hazelcast:hazelcast:5.1.7" + implementation "com.hazelcast:hazelcast-spring:5.1.3" + implementation "javax.cache:cache-api" + implementation "org.apache.commons:commons-lang3" + implementation "commons-io:commons-io" + implementation "javax.transaction:javax.transaction-api" + implementation "org.hibernate:hibernate-entitymanager" + implementation "org.hibernate.validator:hibernate-validator" + implementation "org.springframework.boot:spring-boot-loader-tools" + implementation "org.springframework.security:spring-security-core:5.7.8" + implementation ("org.springframework.boot:spring-boot-starter-logging"){ + exclude group: "org.yaml", module: "snakeyaml" + } + implementation ("org.springframework.boot:spring-boot-starter-actuator"){ + exclude group: "org.yaml", module: "snakeyaml" + exclude group: "com.fasterxml.jackson.core", module: "jackson-databind" + exclude group: "org.springframework.boot", module: "spring-boot-autoconfigure" + exclude group: "org.springframework.boot", module: "spring-boot-actuator-autoconfigure" + } + implementation group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: '2.5.15' + implementation group: 'org.springframework.boot', name: 'spring-boot-actuator-autoconfigure', version: '2.7.11' + implementation ("org.springframework.boot:spring-boot-starter-aop"){ + exclude group: "org.yaml", module: "snakeyaml" + } + implementation ("org.springframework.boot:spring-boot-starter-security"){ + exclude group: "org.yaml", module: "snakeyaml" + exclude group: "org.springframework.security", module: "spring-security-core" + exclude group: "org.springframework.security", module: "spring-security-web" + } + implementation("org.springframework.boot:spring-boot-starter-web"){ + exclude group: "org.yaml", module: "snakeyaml" + exclude group: "com.fasterxml.jackson.core", module: "jackson-databind" + exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat" + exclude group: "org.springframework", module: "spring-webmvc" + } + implementation group: 'org.springframework', name: 'spring-webmvc', version: '5.3.26' + implementation ("org.springframework.boot:spring-boot-starter-tomcat:2.7.5"){ + exclude group: "org.apache.tomcat.embed", module: "tomcat-embed-core" + exclude group: "org.apache.tomcat.embed", module: "tomcat-embed-el" + exclude group: "org.apache.tomcat.embed", module: "tomcat-embed-websocket" + } + implementation ("org.apache.tomcat.embed:tomcat-embed-core:9.0.75"){ + exclude group: "org.apache.tomcat", module: "tomcat-annotations-api" + } + implementation ("org.apache.tomcat:tomcat-annotations-api:9.0.69") + implementation ("org.apache.tomcat.embed:tomcat-embed-el:9.0.69") + implementation ("org.apache.tomcat.embed:tomcat-embed-websocket:9.0.69") + + implementation ("org.zalando:problem-spring-web"){ + exclude group: "com.fasterxml.jackson.core", module: "jackson-databind" + } +// implementation ("org.springframework.cloud:spring-cloud-starter"){ +// exclude group: "org.yaml", module: "snakeyaml" +// } + implementation "org.springframework.retry:spring-retry" +// implementation ("org.springframework.cloud:spring-cloud-starter-config"){ +// exclude group: "org.yaml", module: "snakeyaml" +// } +// implementation ("org.springframework.cloud:spring-cloud-starter-openfeign"){ +// exclude group: "org.yaml", module: "snakeyaml" +// } +// implementation ("org.springframework.boot:spring-boot-starter-cloud-connectors"){ +// exclude group: "org.yaml", module: "snakeyaml" +// } +// implementation "org.springframework.security:spring-security-config" +// implementation "org.springframework.security:spring-security-data" +// implementation "org.springframework.security:spring-security-web" +// implementation "io.jsonwebtoken:jjwt-api" +// runtimeOnly "io.jsonwebtoken:jjwt-impl" +// runtimeOnly "org.springframework.boot:spring-boot-starter-tomcat" +// runtimeOnly "io.jsonwebtoken:jjwt-jackson" +// compileOnly "javax.servlet:javax.servlet-api:3.1.0" + implementation("com.twilio.sdk:twilio:7.1.0") { + exclude module: "jjwt" + exclude group: "com.fasterxml.jackson.core", module: "jackson-databind" + exclude group: "com.google.guava", module: "guava" + } +// implementation 'org.freemarker:freemarker:2.3.23' + implementation group: 'org.springframework.boot', name: 'spring-boot-starter-freemarker' + implementation (group: 'org.xhtmlrenderer', name: 'flying-saucer-pdf-itext5', version: '9.1.22') { + exclude group: "com.itextpdf", module: "itextpdf" + } + implementation (group: 'com.itextpdf', name: 'itextpdf', version: '5.5.13.3') + implementation (group: 'com.sendgrid', name: 'sendgrid-java', version: '4.7.2'){ + exclude group: "com.fasterxml.jackson.core", module: "jackson-databind" + } + implementation group: 'com.sendgrid', name: 'java-http-client', version: '4.1.0' + implementation (group: 'org.springframework.kafka', name: 'spring-kafka') { + exclude group: 'org.xerial.snappy', module: 'snappy-java' + } + implementation group: 'org.xerial.snappy', name: 'snappy-java', version: '1.1.10.1' + implementation group: 'com.microsoft.azure', name: 'azure-storage', version: '8.6.6' + implementation ("io.springfox:springfox-bean-validators") { + exclude group: "com.google.guava", module: "guava" + } + implementation group: 'tech.allegro.schema.json2avro', name: 'converter', version: '0.2.10' + implementation "org.mapstruct:mapstruct:${mapstruct_version}" + implementation group: 'net.minidev', name: 'json-smart', version: '2.4.10' + annotationProcessor "org.mapstruct:mapstruct-processor:${mapstruct_version}" + annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernate_version}" + annotationProcessor "org.glassfish.jaxb:jaxb-runtime:${jaxb_runtime_version}" + annotationProcessor 'org.projectlombok:lombok:1.18.22' + implementation (group: 'org.springframework.boot', name: 'spring-boot-starter-data-mongodb'){ + exclude group: "org.yaml", module: "snakeyaml" + } + annotationProcessor("org.springframework.boot:spring-boot-configuration-processor:${spring_boot_version}") { + exclude group: "com.vaadin.external.google", module: "android-json" + } + testImplementation ("com.jayway.jsonpath:json-path") { + exclude group: "net.minidev", module: "json-smart" + } + testImplementation("org.springframework.boot:spring-boot-starter-test") { + exclude module: "junit" + exclude group: "com.vaadin.external.google", module: "android-json" + exclude group: "org.mockito", module: "mockito-core" + exclude group: "org.yaml", module: "snakeyaml" + exclude group: "org.springframework.boot", module: "spring-boot-autoconfigure" + } + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '2.17.0' + testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.6.0' + testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '1.6.4' + testImplementation ("org.springframework.security:spring-security-test"){ + exclude group: "org.springframework.security", module: "spring-security-core" + exclude group: "org.springframework.security", module: "spring-security-web" + } + testImplementation "org.springframework.boot:spring-boot-test" + testImplementation "org.junit.jupiter:junit-jupiter-engine" + testImplementation "com.tngtech.archunit:archunit-junit5-api:${archunit_junit5_version}" + testRuntimeOnly "com.tngtech.archunit:archunit-junit5-engine:${archunit_junit5_version}" + testImplementation "org.assertj:assertj-core" + testImplementation "junit:junit" + testImplementation "org.mockito:mockito-core" + testImplementation "org.hamcrest:hamcrest-library" + testImplementation group: 'org.mockito', name: 'mockito-inline', version: '2.7.21' + testCompileOnly "javax.servlet:javax.servlet-api:3.1.0" + testImplementation 'org.projectlombok:lombok:1.18.22' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.22' +} + +task cleanResources(type: Delete) { + delete "build/resources" } wrapper { - gradleVersion = "7.3.3" - distributionType = Wrapper.DistributionType.ALL + gradleVersion = "7.1.1" }