diff --git a/build.gradle b/build.gradle index fcb5727b2..de8ff7da7 100644 --- a/build.gradle +++ b/build.gradle @@ -1,174 +1,180 @@ import java.time.Instant /* - * This file was generated by the Gradle 'init' task. + * This file was generated by the Gradle "init" task. */ //buildscript { // repositories { // mavenCentral() // } // dependencies { -// classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.7.0' +// classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}" // } //} plugins { - id 'java' - id 'war' - id 'maven-publish' - id 'org.springframework.boot' version "2.7.3" - id 'com.avast.gradle.docker-compose' version "0.16.9" + id "java" + id "war" + id "maven-publish" + id "org.springframework.boot" version "${springBootVersion}" + id "com.avast.gradle.docker-compose" version "0.16.9" id "com.gorylenko.gradle-git-properties" version "2.4.1" - id 'jacoco' - id 'com.github.kt3k.coveralls' version '2.12.0' - id 'groovy' + id "jacoco" + id "com.github.kt3k.coveralls" version "2.12.0" + id "groovy" // id "com.github.nbaztec.coveralls-jacoco" version "1.2.15" } repositories { mavenLocal() maven { - url = uri('https://nexus.ala.org.au/content/groups/public/') + url = uri("https://nexus.ala.org.au/content/groups/public/") } maven { - url = uri('https://oss.sonatype.org/content/repositories/snapshots') + url = uri("https://oss.sonatype.org/content/repositories/snapshots") } maven { - url = uri('https://repo.maven.apache.org/maven2/') + url = uri("https://repo.maven.apache.org/maven2/") } } -group = 'au.org.ala' -version = '3.7.0-SNAPSHOT' +group = "au.org.ala" +version = "3.7.0-SNAPSHOT" boolean inplace = false configurations { - - all*.exclude group: 'ch.qos.logback' - all*.exclude group: 'javax.servlet', module: 'servlet-api' + all*.exclude group: "log4j", module: "log4j" + all*.exclude group: "org.slf4j", module: "slf4j-log4j12" + all*.exclude group: "javax.servlet", module: "servlet-api" } dependencies { - compileOnly 'org.projectlombok:lombok:1.18.24' - annotationProcessor 'org.projectlombok:lombok:1.18.24' - developmentOnly 'org.springframework.boot:spring-boot-devtools:2.7.0' - -// implementation 'org.springframework.boot:spring-boot-starter-parent:2.7.0' - - implementation 'org.springframework.boot:spring-boot-starter-web:2.7.0' - implementation 'org.apache.tomcat.embed:tomcat-embed-jasper:9.0.55' - implementation 'org.springframework.boot:spring-boot-starter-cache:2.7.0' - implementation 'org.springframework.boot:spring-boot-starter-actuator:2.7.0' - implementation 'org.springframework.boot:spring-boot-starter-validation:2.7.0' - implementation 'org.springframework:spring-oxm:5.3.13' - - implementation 'org.ehcache:ehcache:3.8.1' - implementation 'org.apache.httpcomponents:httpclient-cache:4.5.13' - implementation 'org.hibernate.validator:hibernate-validator:6.2.0.Final' - implementation 'org.apache.solr:solr-solrj:8.11.2' - implementation 'com.datastax.cassandra:cassandra-driver-core:3.11.0' - implementation 'com.datastax.cassandra:cassandra-driver-extras:3.11.0' - implementation 'com.fasterxml.jackson.core:jackson-core:2.13.0' - implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.0' - implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0' - implementation 'org.geotools:gt-opengis:26.0' - implementation 'org.geotools:gt-referencing:26.0' - implementation 'org.geotools:gt-epsg-wkt:26.0' - implementation 'au.org.ala.names:ala-namematching-client:1.8.1' - implementation 'com.googlecode.json-simple:json-simple:1.1.1' - implementation 'au.org.ala:ala-logger:1.4.1' - implementation 'au.org.ala:ala-common-ui:1.0' - implementation 'net.sf.opencsv:opencsv:2.3' - implementation 'net.sf.ehcache:ehcache:2.10.9.2' - implementation 'org.apache.httpcomponents:httpcore:4.4.14' - implementation 'org.apache.httpcomponents:httpclient:4.5.13' - implementation 'commons-lang:commons-lang:2.6' - implementation 'commons-io:commons-io:2.7' - implementation 'org.springdoc:springdoc-openapi-ui:1.5.12' - implementation 'org.springdoc:springdoc-openapi-data-rest:1.5.12' - implementation 'javax.servlet:jstl:1.2' - implementation 'taglibs:standard:1.1.2' - implementation 'com.jayway.jsonpath:json-path:2.4.0' - implementation 'com.sun.mail:jakarta.mail:2.0.1' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client:2.7.0' - implementation 'org.springframework.boot:spring-boot-starter-security:2.7.0' - implementation 'org.springframework.boot:spring-boot-devtools:2.7.0' - implementation 'commons-collections:commons-collections:3.2.2' - implementation 'io.reactivex.rxjava3:rxjava:3.0.6' - implementation 'opensymphony:sitemesh:2.4.2' - implementation 'com.thoughtworks.xstream:xstream:1.4.18' - implementation 'org.slf4j:slf4j-api:1.7.36' - implementation 'org.slf4j:jul-to-slf4j:1.7.36' - implementation 'org.slf4j:slf4j-log4j12:1.7.36' - implementation 'org.apache.velocity:velocity:1.5' - implementation 'org.json:json:20210307' - implementation 'atg.taglib.json:json-taglib:0.4.1' - implementation 'net.sf.json-lib:json-lib:2.2.3' - implementation 'xmlpull:xmlpull:1.1.3.1' - implementation 'commons-httpclient:commons-httpclient:3.1' - implementation 'jfree:jfreechart:1.0.13' - implementation 'com.squareup.retrofit2:retrofit:2.6.2' - implementation 'com.squareup.retrofit2:converter-gson:2.6.2' - implementation 'com.squareup.okhttp3:logging-interceptor:4.3.1' - implementation 'com.squareup.okhttp3:okhttp:4.3.1' - implementation 'au.org.ala:data-quality-filter-service-client:1.0.0' - implementation 'com.auth0:java-jwt:3.18.2' - implementation 'com.auth0:jwks-rsa:0.20.0' - implementation 'org.gbif:gbif-api:1.12.11' - implementation 'org.gbif:dwc-api:1.47' - implementation 'org.apache.commons:commons-compress:1.21' - implementation 'com.google.code.findbugs:jsr305:3.0.2' - implementation 'org.springframework.boot:spring-boot-autoconfigure:2.7.0' + compileOnly "org.projectlombok:lombok:1.18.24" + annotationProcessor "org.projectlombok:lombok:1.18.24" + developmentOnly "org.springframework.boot:spring-boot-devtools:${springBootVersion}" + + // Netty native transport dependencies, otherwise complains about missing linked library + implementation 'io.netty:netty-transport-native-epoll:4.1.119.Final:linux-x86_64' + implementation 'io.netty:netty-transport-native-epoll:4.1.119.Final:linux-aarch_64' + +// implementation "org.springframework.boot:spring-boot-starter-parent:${springBootVersion}" + + implementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}" + implementation "org.apache.tomcat.embed:tomcat-embed-jasper:9.0.55" + implementation "org.springframework.boot:spring-boot-starter-cache:${springBootVersion}" + implementation "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}" + implementation "org.springframework.boot:spring-boot-starter-validation:${springBootVersion}" + implementation "org.springframework:spring-oxm:${springVersion}" + + implementation "org.ehcache:ehcache:3.8.1" + implementation "org.apache.httpcomponents:httpclient-cache:4.5.13" + implementation "org.hibernate.validator:hibernate-validator:6.2.0.Final" + implementation "org.apache.solr:solr-solrj:${solrVersion}" + implementation "com.datastax.cassandra:cassandra-driver-core:${cassandraVersion}" + implementation "com.datastax.cassandra:cassandra-driver-extras:${cassandraVersion}" + implementation "com.fasterxml.jackson.core:jackson-core:2.13.0" + implementation "com.fasterxml.jackson.core:jackson-annotations:2.13.0" + implementation "com.fasterxml.jackson.core:jackson-databind:2.13.0" + implementation "org.geotools:gt-opengis:26.0" + implementation "org.geotools:gt-referencing:26.0" + implementation "org.geotools:gt-epsg-wkt:26.0" + implementation "au.org.ala.names:ala-namematching-client:1.8.1" + implementation "com.googlecode.json-simple:json-simple:1.1.1" + implementation "au.org.ala:ala-logger:1.4.1" + implementation "au.org.ala:ala-common-ui:1.0" + implementation "net.sf.opencsv:opencsv:2.3" + implementation "net.sf.ehcache:ehcache:2.10.9.2" + implementation "org.apache.httpcomponents:httpcore:4.4.14" + implementation "org.apache.httpcomponents:httpclient:4.5.13" + implementation "commons-lang:commons-lang:2.6" + implementation "commons-io:commons-io:2.7" + implementation "org.springdoc:springdoc-openapi-ui:1.5.12" + implementation "org.springdoc:springdoc-openapi-data-rest:1.5.12" + implementation "javax.servlet:jstl:1.2" + implementation "taglibs:standard:1.1.2" + implementation "com.jayway.jsonpath:json-path:2.4.0" + implementation "com.sun.mail:jakarta.mail:2.0.1" + implementation "org.springframework.boot:spring-boot-starter-oauth2-client:${springBootVersion}" + implementation "org.springframework.boot:spring-boot-starter-security:${springBootVersion}" + implementation "org.springframework.boot:spring-boot-devtools:${springBootVersion}" + implementation "commons-collections:commons-collections:3.2.2" + implementation "io.reactivex.rxjava3:rxjava:3.0.6" + implementation "opensymphony:sitemesh:2.4.2" + implementation "com.thoughtworks.xstream:xstream:1.4.18" + + implementation "org.slf4j:slf4j-api:1.7.36!!" + implementation "org.slf4j:jul-to-slf4j:1.7.36!!" + implementation "org.slf4j:log4j-over-slf4j:1.7.36!!" + + implementation "org.apache.velocity:velocity:1.5" + implementation "org.json:json:20210307" + implementation "atg.taglib.json:json-taglib:0.4.1" + implementation "net.sf.json-lib:json-lib:2.2.3" + implementation "xmlpull:xmlpull:1.1.3.1" + implementation "commons-httpclient:commons-httpclient:3.1" + implementation "jfree:jfreechart:1.0.13" + implementation "com.squareup.retrofit2:retrofit:2.6.2" + implementation "com.squareup.retrofit2:converter-gson:2.6.2" + implementation "com.squareup.okhttp3:logging-interceptor:4.3.1" + implementation "com.squareup.okhttp3:okhttp:4.3.1" + implementation "au.org.ala:data-quality-filter-service-client:1.0.0" + implementation "com.auth0:java-jwt:3.18.2" + implementation "com.auth0:jwks-rsa:0.20.0" + implementation "org.gbif:gbif-api:1.12.11" + implementation "org.gbif:dwc-api:1.47" + implementation "org.apache.commons:commons-compress:1.21" + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "org.springframework.boot:spring-boot-autoconfigure:${springBootVersion}" if (inplace) { - implementation project(':ala-ws-spring-security') - implementation project(':ala-ws-security') + implementation project(":ala-ws-spring-security") + implementation project(":ala-ws-security") } else { - implementation 'au.org.ala:ala-ws-spring-security:6.3.0-SNAPSHOT' + implementation "au.org.ala:ala-ws-spring-security:6.3.0-SNAPSHOT" } - implementation 'org.codehaus.groovy:groovy-all:3.0.11' - - testImplementation 'org.codehaus.groovy:groovy-all:3.0.11' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' - testImplementation 'org.junit.jupiter:junit-jupiter-migrationsupport:5.9.1' - testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.1' - testImplementation 'org.junit.platform:junit-platform-launcher' - testImplementation 'org.junit.platform:junit-platform-commons' - testImplementation 'org.junit.vintage:junit-vintage-engine:5.9.1' -// testImplementation 'junit:junit:4.13.1' - testImplementation 'org.apiguardian:apiguardian-api:1.1.0' - testImplementation 'org.mockito:mockito-core:3.4.4' - testImplementation 'org.powermock:powermock-module-junit4:2.0.7' - testImplementation 'org.powermock:powermock-api-mockito2:2.0.7' - testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0' - testImplementation 'org.spockframework:spock-spring:2.3-groovy-3.0' - testImplementation 'net.bytebuddy:byte-buddy:1.10.13' - testImplementation 'org.hamcrest:hamcrest:2.1' - testImplementation 'org.hamcrest:hamcrest-library:2.1' - testImplementation 'org.springframework.security:spring-security-test:5.7.1' - testImplementation 'com.squareup.retrofit2:retrofit-mock:2.6.2' - testImplementation 'org.codehaus.groovy:groovy:2.5.14' - testImplementation 'org.springframework:spring-tx:5.3.9' - - implementation 'javax.servlet:javax.servlet-api:4.0.1' - implementation 'javax.servlet:jsp-api:2.0' - - providedRuntime 'javax.el:javax.el-api:3.0.0' - providedRuntime 'org.glassfish:javax.el:3.0.0' + implementation "org.codehaus.groovy:groovy-all:3.0.11" + + testImplementation "org.codehaus.groovy:groovy-all:3.0.11" + testImplementation "org.junit.jupiter:junit-jupiter-api:5.9.1" + testImplementation "org.junit.jupiter:junit-jupiter-migrationsupport:5.9.1" + testImplementation "org.junit.jupiter:junit-jupiter-engine:5.9.1" + testImplementation "org.junit.platform:junit-platform-launcher" + testImplementation "org.junit.platform:junit-platform-commons" + testImplementation "org.junit.vintage:junit-vintage-engine:5.9.1" +// testImplementation "junit:junit:4.13.1" + testImplementation "org.apiguardian:apiguardian-api:1.1.0" + testImplementation "org.mockito:mockito-core:3.4.4" + testImplementation "org.powermock:powermock-module-junit4:2.0.7" + testImplementation "org.powermock:powermock-api-mockito2:2.0.7" + testImplementation "org.spockframework:spock-core:2.3-groovy-3.0" + testImplementation "org.spockframework:spock-spring:2.3-groovy-3.0" + testImplementation "net.bytebuddy:byte-buddy:1.10.13" + testImplementation "org.hamcrest:hamcrest:2.1" + testImplementation "org.hamcrest:hamcrest-library:2.1" + testImplementation "org.springframework.security:spring-security-test:5.7.1" + testImplementation "com.squareup.retrofit2:retrofit-mock:2.6.2" + testImplementation "org.codehaus.groovy:groovy:2.5.14" + testImplementation "org.springframework:spring-tx:5.3.9" + + implementation "javax.servlet:javax.servlet-api:4.0.1" + implementation "javax.servlet:jsp-api:2.0" + + providedRuntime "javax.el:javax.el-api:3.0.0" + providedRuntime "org.glassfish:javax.el:3.0.0" } sourceSets { test { groovy { - srcDirs = ['src/test/java'] + srcDirs = ["src/test/java"] } java { - srcDirs = ['src/test/java'] + srcDirs = ["src/test/java"] } } } @@ -186,20 +192,20 @@ bootWar { } war { - archiveClassifier = '' + archiveClassifier = "" } tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' + options.encoding = "UTF-8" } gitProperties { - extProperty = 'gitProps' + extProperty = "gitProps" } processResources { - dependsOn('generateGitProperties') - filesMatching('**/runtimeEnvironment.properties') { + dependsOn("generateGitProperties") + filesMatching("**/runtimeEnvironment.properties") { expand( build: [ timestamp: Instant.now() ], project: [ version: project.version ], @@ -207,20 +213,20 @@ processResources { java: [ version: org.gradle.internal.jvm.Jvm.current() ], ) } - filesMatching('**/buildInfo.properties') { + filesMatching("**/buildInfo.properties") { expand( git: [ commit: [ - time: project.ext.gitProps['git.commit.time'], - id: project.ext.gitProps['git.commit.id'], - shortId: project.ext.gitProps['git.commit.id.abbrev'] + time: project.ext.gitProps["git.commit.time"], + id: project.ext.gitProps["git.commit.id"], + shortId: project.ext.gitProps["git.commit.id.abbrev"] ], - branch: project.ext.gitProps['git.branch'], + branch: project.ext.gitProps["git.branch"], closest: [ tag: [ - name: project.ext.gitProps['git.closest.tag.name'], + name: project.ext.gitProps["git.closest.tag.name"], commit: [ - count: project.ext.gitProps['git.closest.tag.commit.count'] + count: project.ext.gitProps["git.closest.tag.commit.count"] ] ] ] @@ -235,11 +241,11 @@ dockerCompose { } test { - finalizedBy 'jacocoTestReport' // report is always generated after tests run + finalizedBy "jacocoTestReport" // report is always generated after tests run } jacocoTestReport { - dependsOn 'test' // tests are required to run before generating the report + dependsOn "test" // tests are required to run before generating the report reports { xml.enabled = true html.enabled = true @@ -247,17 +253,17 @@ jacocoTestReport { } tasks.coveralls { - dependsOn 'check' + dependsOn "check" } publishing { repositories { maven { - name 'Nexus' + name "Nexus" url "https://nexus.ala.org.au/content/repositories/${project.version.endsWith('-SNAPSHOT') ? 'snapshots' : 'releases' }" credentials { - username = System.getenv('TRAVIS_DEPLOY_USERNAME') - password = System.getenv('TRAVIS_DEPLOY_PASSWORD') + username = System.getenv("TRAVIS_DEPLOY_USERNAME") + password = System.getenv("TRAVIS_DEPLOY_PASSWORD") } } } @@ -268,21 +274,21 @@ publishing { // artifact javadocJar pom { - name = 'Biocache Service' - description = 'Occurrence & mapping webservices' - url = 'https://github.com/AtlasOfLivingAustralia/biocache-service' + name = "Biocache Service" + description = "Occurrence & mapping webservices" + url = "https://github.com/AtlasOfLivingAustralia/biocache-service" licenses { license { - name = 'MPL-1.1' - url = 'https://www.mozilla.org/en-US/MPL/1.1/' + name = "MPL-1.1" + url = "https://www.mozilla.org/en-US/MPL/1.1/" } } developers { } scm { - connection = 'scm:git:git://github.com/AtlasOfLivingAustralia/biocache-service.git' - developerConnection = 'scm:git:ssh://github.com:AtlasOfLivingAustralia/biocache-service.git' - url = 'https://github.com/AtlasOfLivingAustralia/biocache-service' + connection = "scm:git:git://github.com/AtlasOfLivingAustralia/biocache-service.git" + developerConnection = "scm:git:ssh://github.com:AtlasOfLivingAustralia/biocache-service.git" + url = "https://github.com/AtlasOfLivingAustralia/biocache-service" } } from components.web diff --git a/gradle.properties b/gradle.properties index bdd3dc784..3bbb9e2a0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -springVersion=5.3.9 -springBootVersion=2.5.7 -solrVersion=8.11.0 -cassandraVersion=3.11.0 \ No newline at end of file +springVersion=5.3.31 +springBootVersion=2.7.18 +solrVersion=8.11.4 +cassandraVersion=3.11.5 \ No newline at end of file diff --git a/src/main/resources/log4j.xml b/src/main/resources/log4j.xml deleted file mode 100644 index 4f622b69d..000000000 --- a/src/main/resources/log4j.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 000000000..b305677c7 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,36 @@ + + + + + + + + + UTF-8 + %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(%logger{39} [%file:%line]){cyan} %clr(:){faint} %m%n%wex + + + + + + + + + + + + + + + + + + + + + + + + + +