From 8200877f9f31b655e4da34595d95776af3c1f830 Mon Sep 17 00:00:00 2001 From: Brandon Clayton <bclayton@usgs.gov> Date: Wed, 24 Mar 2021 09:24:39 -0600 Subject: [PATCH] update to Micronaut v2 --- build.gradle | 1 - gradle.properties | 9 +++------ gradle/dependencies.gradle | 8 ++++---- .../earthquake/nshmp/netcdf/www/NetcdfController.java | 4 ++-- .../usgs/earthquake/nshmp/netcdf/www/NetcdfService.java | 8 ++++---- .../usgs/earthquake/nshmp/netcdf/www/NetcdfWsUtils.java | 2 +- 6 files changed, 14 insertions(+), 18 deletions(-) diff --git a/build.gradle b/build.gradle index a6b028b..ae4d8ff 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,6 @@ plugins { id "jacoco" id "java" id "maven-publish" - id "net.ltgt.apt-eclipse" version "${aptEclipseVersion}" } sourceCompatibility = JavaVersion.VERSION_11 diff --git a/gradle.properties b/gradle.properties index f03d02e..40e9828 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,17 +1,14 @@ -aptEclipseVersion = 0.21 cdmVersion = 5.1.0 githooksVersion = 1.2.0 jacksonVersion = 2.9.0 junitVersion = 5.5.2 -logbackVersion = 1.2.3 -mnOpenAPIVersion = 1.4.0 -mnVersion = 1.3.2 +mnVersion = 2.4.1 netcdfVersion = 5.1.0 nodeVersion = 3.0.1 nshmpLibVersion = 0.3.1 nshmpWsUtilsVersion = 0.1.1 -shadowVersion = 5.2.0 +shadowVersion = 6.1.0 slfVersion = 1.7.30 spotbugsVersion = 4.2.4 spotlessVersion = 4.1.0 -swaggerVersion = 2.1.1 +swaggerVersion = 2.1.7 diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 5db843e..f7acf6d 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -20,12 +20,12 @@ dependencies { implementation "io.micronaut:micronaut-runtime" implementation "io.micronaut:micronaut-http-server-netty" implementation "com.fasterxml.jackson.module:jackson-module-parameter-names:${jacksonVersion}" - runtimeOnly "ch.qos.logback:logback-classic:${logbackVersion}" + runtimeOnly "ch.qos.logback:logback-classic" // Swagger - annotationProcessor("io.micronaut.configuration:micronaut-openapi:${mnOpenAPIVersion}") - implementation("io.swagger.core.v3:swagger-annotations:${swaggerVersion}") - implementation("io.swagger.core.v3:swagger-models:${swaggerVersion}") + annotationProcessor("io.micronaut.configuration:micronaut-openapi") + implementation("io.swagger.core.v3:swagger-annotations") + implementation("io.swagger.core.v3:swagger-models") // junit testAnnotationProcessor "io.micronaut:micronaut-inject-java:${mnVersion}" diff --git a/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java b/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java index 42129d2..0ca245f 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfController.java @@ -2,15 +2,15 @@ package gov.usgs.earthquake.nshmp.netcdf.www; import java.nio.file.Path; -import javax.annotation.Nullable; import javax.inject.Inject; import gov.usgs.earthquake.nshmp.gmm.Imt; import gov.usgs.earthquake.nshmp.gmm.NehrpSiteClass; -import gov.usgs.earthquake.nshmp.www.NshmpMicronautServlet; import gov.usgs.earthquake.nshmp.netcdf.NshmGroup; +import gov.usgs.earthquake.nshmp.www.NshmpMicronautServlet; import io.micronaut.context.annotation.Value; +import io.micronaut.core.annotation.Nullable; import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; import io.micronaut.http.MediaType; diff --git a/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfService.java b/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfService.java index d020df0..456dff4 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfService.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfService.java @@ -14,9 +14,6 @@ import gov.usgs.earthquake.nshmp.geo.json.Feature; import gov.usgs.earthquake.nshmp.geo.json.GeoJson; import gov.usgs.earthquake.nshmp.gmm.Imt; import gov.usgs.earthquake.nshmp.gmm.NehrpSiteClass; -import gov.usgs.earthquake.nshmp.www.Response; -import gov.usgs.earthquake.nshmp.www.WsUtils; -import gov.usgs.earthquake.nshmp.www.meta.Status; import gov.usgs.earthquake.nshmp.netcdf.NshmGroup; import gov.usgs.earthquake.nshmp.netcdf.NshmNetcdfReader; import gov.usgs.earthquake.nshmp.netcdf.reader.BoundingHazards; @@ -25,6 +22,9 @@ import gov.usgs.earthquake.nshmp.netcdf.reader.StaticHazards; import gov.usgs.earthquake.nshmp.netcdf.www.NetcdfController.Query; import gov.usgs.earthquake.nshmp.netcdf.www.NetcdfController.Service; import gov.usgs.earthquake.nshmp.netcdf.www.NetcdfWsUtils.Key; +import gov.usgs.earthquake.nshmp.www.Response; +import gov.usgs.earthquake.nshmp.www.WsUtils; +import gov.usgs.earthquake.nshmp.www.meta.Status; import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; @@ -321,7 +321,7 @@ public class NetcdfService { Metadata(HttpRequest<?> request, NshmGroup nshmGroup, String netcdfFile) { var url = request.getUri().toString(); description = String.format(SERVICE_DESCRIPTION, nshmGroup.toString()); - syntax = new String[]{ + syntax = new String[] { url + "/{longitude:number}/{latitude:number}", url + "?longitude={number}&latitude={number}", url + "/{longitude:number}/{latitude:number}/{siteClass:NehrpSiteClass}", diff --git a/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfWsUtils.java b/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfWsUtils.java index 44a6ed5..4ecec34 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfWsUtils.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfWsUtils.java @@ -10,11 +10,11 @@ import com.google.gson.GsonBuilder; import gov.usgs.earthquake.nshmp.gmm.Imt; import gov.usgs.earthquake.nshmp.gmm.NehrpSiteClass; +import gov.usgs.earthquake.nshmp.netcdf.NshmGroup; import gov.usgs.earthquake.nshmp.www.Response; import gov.usgs.earthquake.nshmp.www.WsUtils.EnumSerializer; import gov.usgs.earthquake.nshmp.www.WsUtils.NaNSerializer; import gov.usgs.earthquake.nshmp.www.meta.Status; -import gov.usgs.earthquake.nshmp.netcdf.NshmGroup; import io.micronaut.http.HttpResponse; -- GitLab