Skip to content

Commit

Permalink
build: plugin 6.3.5, gradle 8.0.2, standardized project names, jakart…
Browse files Browse the repository at this point in the history
…a validation (#233)
  • Loading branch information
wetted authored Mar 16, 2023
1 parent ed3be15 commit a1e8b3a
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 33 deletions.
6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ micronaut-docs = '2.0.0'
micronaut-test = "4.0.0-SNAPSHOT"

micronaut-serde = "2.0.0-SNAPSHOT"
micronaut-validation = "4.0.0-SNAPSHOT"

groovy = "4.0.6"
kotlin = '1.7.22'
groovy = "4.0.10"
kotlin = '1.8.10'
spock = "2.3-groovy-4.0"

managed-zalando-problem="0.27.1"

[libraries]
# micronaut boms
micronaut-serde = { module = "io.micronaut.serde:micronaut-serde-bom", version.ref = "micronaut-serde" }
micronaut-validation = { module = "io.micronaut.validation:micronaut-validation-bom", version.ref = "micronaut-validation" }

managed-zalando-problem = { module = "org.zalando:problem", version.ref = "managed-zalando-problem" }
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion problem-json/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ plugins {

dependencies {
annotationProcessor(mnSerde.micronaut.serde.processor)
annotationProcessor(mnValidation.micronaut.validation.processor)

api(libs.managed.zalando.problem)
implementation(mnSerde.micronaut.serde.api)
implementation(mnSerde.micronaut.serde.jackson)
implementation(mn.micronaut.validation)
implementation(mnValidation.micronaut.validation)
implementation(mn.micronaut.http.server)

testImplementation(mnValidation.micronaut.validation.processor)
testImplementation(mn.micronaut.http.server.netty)
testImplementation(mn.micronaut.http.client)
testAnnotationProcessor(mn.micronaut.inject.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
import io.micronaut.http.server.exceptions.response.ErrorResponseProcessor;
import io.micronaut.problem.HttpStatusType;
import io.micronaut.validation.exceptions.ConstraintExceptionHandler;

import jakarta.inject.Singleton;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.ConstraintViolationException;

import java.util.stream.Collectors;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

import io.micronaut.core.annotation.NonNull;
import io.micronaut.serde.annotation.Serdeable;

import javax.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotBlank;

/**
* Constraint Violation information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
/**
* Contains classes for rendering {@link javax.validation.ConstraintViolationException} as Problem.
* Contains classes for rendering {@link jakarta.validation.ConstraintViolationException} as Problem.
* @author Sergio del Amo
* @since 1.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.micronaut.problem

import io.micronaut.context.annotation.Requires
import io.micronaut.core.annotation.Introspected
import io.micronaut.core.annotation.NonNull
import io.micronaut.core.annotation.Nullable
import io.micronaut.core.type.Argument
Expand All @@ -13,10 +12,9 @@ import io.micronaut.http.annotation.Post
import io.micronaut.http.annotation.Status
import io.micronaut.http.client.exceptions.HttpClientResponseException
import io.micronaut.serde.annotation.Serdeable

import javax.validation.Valid
import javax.validation.constraints.NotBlank
import javax.validation.constraints.NotNull
import jakarta.validation.Valid
import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.NotNull

class ConstraintViolationProblemSpec extends EmbeddedServerSpecification {

Expand Down
4 changes: 3 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ pluginManagement {
}

plugins {
id("io.micronaut.build.shared.settings") version "6.2.2"
id("io.micronaut.build.shared.settings") version "6.3.5"
}

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

micronautBuild {
addSnapshotRepository()
useStandardizedProjectNames = true
importMicronautCatalog()
importMicronautCatalog("micronaut-serde")
importMicronautCatalog("micronaut-validation")
}

rootProject.name = 'problem-json-parent'
Expand Down
8 changes: 7 additions & 1 deletion src/main/docs/guide/breaks.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
=== Micronaut Problem JSON 3.0.0

Starting with Micronaut Framework 4.0.0, Micronaut Problem JSON is based on `jakarta.validation` rather than `javax.validation` as in previous versions.

=== Micronaut Problem JSON 2.2.3

The default Problem+JSON payload does not include the `detail` field to avoid accidental information disclosure if the exception root cause is not of type `UnsatisfiedRouteException` or `ThrowableProblem` to avoid accidental information disclosure since 2.2.3.

You can <<customizingProblemErrorResponseProcessor, customize it>> to include always the detail or for some scenarios.
You can <<customizingProblemErrorResponseProcessor, customize it>> to include always the detail or for some scenarios.
5 changes: 3 additions & 2 deletions test-suite-groovy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ plugins {
}

dependencies {
testCompileOnly(mnValidation.micronaut.validation.processor)
testCompileOnly mn.micronaut.inject.groovy
testImplementation mn.micronaut.validation
testImplementation mnValidation.micronaut.validation
testImplementation mnTest.micronaut.test.spock
testImplementation projects.problemJson
testImplementation projects.micronautProblemJson
testImplementation mn.micronaut.http.server.netty
testImplementation mn.micronaut.http.client
}
Expand Down
8 changes: 5 additions & 3 deletions test-suite-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ repositories {
}

dependencies {
testImplementation mn.micronaut.validation
testAnnotationProcessor mnValidation.micronaut.validation.processor
testAnnotationProcessor(mnSerde.micronaut.serde.processor)

testImplementation mnValidation.micronaut.validation
testImplementation libs.junit.api
testImplementation mnTest.micronaut.test.junit5
testRuntimeOnly libs.junit.engine
testImplementation libs.kotlin.stdlib.jdk8
kaptTest mn.micronaut.inject.java
testImplementation projects.problemJson
testImplementation projects.micronautProblemJson
testImplementation mn.micronaut.http.server.netty
testImplementation mn.micronaut.http.client
testAnnotationProcessor(mnSerde.micronaut.serde.processor)
testImplementation(mnSerde.micronaut.serde.jackson)
}

Expand Down
6 changes: 3 additions & 3 deletions test-suite-serde-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ plugins {

dependencies {
testAnnotationProcessor mn.micronaut.inject.java
testAnnotationProcessor mn.micronaut.validation
testAnnotationProcessor mnValidation.micronaut.validation.processor
testAnnotationProcessor mnSerde.micronaut.serde.processor

testImplementation mn.micronaut.validation
testImplementation mnValidation.micronaut.validation
testImplementation libs.junit.api
testImplementation mnTest.micronaut.test.junit5
testRuntimeOnly libs.junit.engine
testImplementation mn.micronaut.http.server.netty
testImplementation mn.micronaut.http.client
testImplementation projects.problemJson
testImplementation projects.micronautProblemJson
testImplementation(mnSerde.micronaut.serde.jackson)
}
tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import io.micronaut.serde.annotation.Serdeable;
import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
import jakarta.inject.Inject;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import org.junit.jupiter.api.Test;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.Collections;
import java.util.Map;

Expand Down
6 changes: 3 additions & 3 deletions test-suite/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ plugins {

dependencies {
testAnnotationProcessor mn.micronaut.inject.java
testAnnotationProcessor mn.micronaut.validation
testImplementation mn.micronaut.validation
testAnnotationProcessor mnValidation.micronaut.validation.processor
testImplementation mnValidation.micronaut.validation
testImplementation mn.logback.classic
testImplementation libs.junit.api
testImplementation mnTest.micronaut.test.junit5
testRuntimeOnly libs.junit.engine
testImplementation mn.micronaut.http.server.netty
testImplementation mn.micronaut.http.client
testImplementation projects.problemJson
testImplementation projects.micronautProblemJson

testAnnotationProcessor(mnSerde.micronaut.serde.processor)
testImplementation(mnSerde.micronaut.serde.jackson)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
import io.micronaut.http.client.exceptions.HttpClientResponseException;
import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
import jakarta.inject.Inject;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import org.junit.jupiter.api.Test;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;

import java.util.Collections;
import java.util.Map;

Expand Down

0 comments on commit a1e8b3a

Please sign in to comment.