Skip to content

Instantly share code, notes, and snippets.

Avatar
🖥️
I may be slow to respond.

Vladimir Orany musketyr

🖥️
I may be slow to respond.
View GitHub Profile
View dependencies.gradle
subprojects {
dependencies
modules {
module('io.micronaut:micronaut-views-handlebars') {
replacedBy('io.micronaut.views:micronaut-views-handlebars', 'New coordinates for Micronaut 2.x')
}
}
}
}
View build.gradle
plugins {
id "net.ltgt.apt-eclipse" version "0.21"
id "com.github.johnrengelman.shadow" version "5.2.0"
id "application"
}
version "0.1"
group "micronaut.one.compatibility"
repositories {
View conventions.groovy
Map conventions = [
disable : false,
whiteListScripts : true,
disableDynamicCompile : false,
dynamicCompileWhiteList : [
'UrlMappings',
'Application',
'BootStrap',
'resources',
'org.grails.cli'
View HelloDataSetsSpec.groovy
import com.agorapulse.dru.Dru
import hello.legacy.model.Vehicle
import hello.legacy.model.VehicleRepository
import io.micronaut.context.ApplicationContext
import io.micronaut.context.ApplicationContextProvider
import io.micronaut.test.annotation.MicronautTest
import spock.lang.AutoCleanup
import spock.lang.Specification
import javax.inject.Inject
View application-test.yml
datasources:
default:
url: jdbc:tc:mariadb:10.5.10:///test?useSSL=false&TC_DAEMON=true
driverClassName: org.testcontainers.jdbc.ContainerDatabaseDriver
username: grails
password: grails
dialect: MYSQL
jpa:
default:
entity-scan:
View hello-data-test-data.gradle
dependencies {
api project(':hello-data')
api "com.agorapulse:dru-client-micronaut-data:0.8.1"
api "com.agorapulse:dru-parser-json:0.8.1"
compileOnly "io.micronaut:micronaut-inject-groovy:$micronautVersion"
testImplementation platform("io.micronaut:micronaut-bom:$micronautVersion")
View hello-data.gradle
dependencies {
annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
annotationProcessor 'io.micronaut.data:micronaut-data-processor'
annotationProcessor 'io.micronaut:micronaut-inject-java'
annotationProcessor 'io.micronaut:micronaut-validation'
api platform("io.micronaut:micronaut-bom:$micronautVersion")
api 'io.micronaut.data:micronaut-data-hibernate-jpa'
api 'jakarta.persistence:jakarta.persistence-api:2.2.2'
View VehicleRepository.groovy
import io.micronaut.data.annotation.Repository
import io.micronaut.data.repository.CrudRepository
@Repository
interface VehicleRepository extends CrudRepository<Vehicle, Long> {
}
View Vehicle.groovy
import groovy.transform.CompileStatic
import javax.annotation.Nullable
import javax.persistence.Entity
import javax.persistence.GeneratedValue
import javax.persistence.GenerationType
import javax.persistence.Id
import javax.persistence.Version
import javax.validation.constraints.NotNull
import javax.validation.constraints.Pattern
import javax.validation.constraints.Size
View Vehicle.groovy
import grails.gorm.annotation.Entity
@Entity
class Vehicle {
String name
String make
String model