Skip to content

v2024.0.0-M2

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 02 Jan 11:06
· 3 commits to 2024.0.x since this release
ac0a849

What's Changed

⭐️ New Features

Modularizing the codebase

Spring Boot 4 has refactored its codebase into a more modular structure, I believe this is the right direction for the future.
The Grace framework 2024 & 2025 will also start doing this. Grace's plugins will be independent, more focused, and at the same time, they will integrate better with Spring Boot's modules.

Core plugins have been consolidated into the framework

🐞 Bug Fixes

  • 9b924d4 Fix deprecation warnings due to tasks calling getProject() at execution time #1297

  • 2099e41 Fix type cast warnnings in ParameterizedGrailsUnitTest #1292

  • cea4095 Fixes the resources in the app/* not found in development mode #1251

    • ResourceLocator should use BuildSettings.GRAILS_APP_PATH instead of GrailsResourceUtils.GRAILS_APP_DIR
  • 8666cb7 Fixes errors for using project.register(copyAstClasses) #1164

🛠 Improvements

  • 08617b1 Don't include unused jars in the Shell CLI binary #1296

  • c576e84 Decouple grace-web from grace-databinding GrailsParameterMap and PropertyEditorRegistryUtils use DataBinder.DEFAULT_DATE_FORMAT

  • 18de6f8 Restore grace-web-databinding module

  • 807815e Remove explicit dependency on grace-plugin-rest for grace-boot-web #1294

  • ffb12df Add explicit dependency on grace-views-markup for grace-boot-rest #1293

  • f954482 Provide install and help commands for fields plugin #1291

  • f3d12f9 Update StartScriptGenerator templates for Grace Shell #1290

  • 279be59 Exclude the plugins that have been consolidated into framework #1288

  • 12b852d Update CreateAppCommand to support creating a minimal Grace 2024.0 app #1287

  • 00b9d03 Migrate to Maven Central Portal Snapshots when using SNAPSHOT version to generate new project #1286

  • 686e5d7 Provide org.graceframework.grace-app plugin #1285

  • 8df446b Make Gradle dependencies sorted and grouped by scope and dependency #1283

  • badedbe Update autoconfigure compiler for Grace Application #1282

  • 81511cb Provide install command for geb plugin to configure selenium drivers #1281

  • 788f94c Add selenium api and drivers dependencies for geb plugin #1280

  • ac4403c Plugins contain scripts and templates should include these into resources when packaging #1279

    • grace-plugin-database-migration
    • grace-plugin-fields
    • grace-plugin-geb
    • grace-plugin-scaffolding
  • 839ca74 Grace Boot MongoDb: add missing grails-plugin.xml #1278

  • 5b6cfbb Grace Boot Hibernate: add missing grails-plugin.xml #1277

  • 3df9acc Grace Boot Web: Remove unnecessary dependency on grace-plugin-gsp #1276

  • b51fade Grace Boot: Remove unnecessary dependency on grace-web #1275

  • 722515a Cleanup dependency on grace-plugin-api #1274

    • grace-core do not expose grace-plugin-api any more, so all the plugins should explicit depend on it.
    • grace-web only use grace-plugin-api compileOnly now.
  • e551777 Use PropertySourcesPropertyResolver provided by Spring Framework #1273

    • Don't use ConfigurationPropertySources provided by Spring Boot, because some tags do not depend on Spring Boot
  • 5bfd01b Update dependencies for grace-boot-mongodb #1120

  • 16de4f5 Update README - Update the versions of Groovy, Gradle, Spring Boot

  • 99b6884 Remove duplicated grails.factories in grace-web-url-mappings #1245

  • 737b52f Update migration.gdsl in the database-migration plugin #1240

    • Correct the migrationDir to db/migrations
    • Correct the column methods definded in createTable addColumn createIndex insert loadData loadUpdateData update
  • 9226c41 Add missing 'grails.factories' for 'database-migration' plugin

  • 8b9a2e0 Add missing 'grails-plugin.xml' for 'geb' plugin

  • 223744d Add missing 'grails-plugin.xml' for 'database-migration' plugin

  • 8c06e3a Remove unused plugins in the gradle/grails.versions.toml

  • 5e96dfe Rearrange versions and libraries in the gradle/libs.versions.toml

  • aa44851 Code formatting with Checkstyle and Codenarc

  • ff8ab2e Add dependencies to Gradle Version Catalog

    • Add glassfish-expressly
    • Add hibernate-core
    • Add spring-orm
  • 04ae29f Merge hibernate plugin into the framework #1229

    • 4cbe4ae Cleanup build scripts
    • 48f7fad Code formatting
    • 5cece78 Code formatting with Checkstyle and Codenarc
  • 5abdc5e Update the BOM of Grace Dependencies #1220

  • d2638e2 Update Gradle Version Catalog after importing 'cache' 'fields' 'scaffolding' 'views' plugins #1219

  • 05980f8 Rename the package of Grace Views #1218

    • Change the package of grace-views-json from grails.plugin.json.view => org.grails.views.json
    • Change the package of grace-views-markup from grails.plugin.markup.view => org.grails.views.markup
  • 1070acb Refactor Grace Json View API: Use native groovy.json.* API instead #1217

    • Remove grails.plugin.json.builder.StreamingJsonBuilder
    • Remove grails.plugin.json.builder.JsonOutput
    • Remove grails.plugin.json.builder.JsonGenerator
    • Remove grails.plugin.json.builder.DefaultJsonGenerator
    • Add grails.plugin.json.view.api.JsonWritable
    • Add grails.plugin.json.util.JsonToken
  • 6f352e4 Refactor Grace Views Format Java and Groovy source and test code #1216

  • 1095028 Merge grace-views into the framework #1215

    • Merge grace-views-gradle into grace-gradle-plugin
    • Merge grace-views-json-testing-support into grace-test-support
    • Update Gradle build script
    • Update ViewsTransform JsonViewsTransform MarkupViewsTransform MarkupViewTemplateEngine
    • Make tests works
  • 63de64a Refactor Grace Fields Plugin #1214

  • ef9944c Refactor Grace Scaffolding Core and Plugin #1213

  • bdecfc0 Make grace-plugin-fields and grace-plugin-scaffolding works #1211 #1212

    • Add grace-scaffolding-core grace-plugin-fields grace-plugin-scaffolding submodules
    • Update Gradle build script
    • Add grails-plugin.xml for grace-plugin-fields and grace-plugin-scaffolding
    • Add @TagLib to FormFieldsTagLib
    • Update ContextMarkupRenderer ContextMarkupRendererImpl DomainMarkupRendererImpl DelegatingBeanPropertyAccessorImpl
    • Update DomainMarkupRendererSpec and FormFieldsTemplateServiceSpec
  • e0ace00 Refactor Grace Cache Core and Plugin #1210

  • 566f3d2 Make grace-cache-core and grace-plugin-cache works #1209

    • Add grace-cache-core and grace-plugin-cache submodules
    • Update Gradle build script
    • Add grails-plugin.xml
    • Add @TagLib to grails-plugin.xml
    • Migrate some JUnit 4 tests to JUnit 5
    • Remove demo tests
  • 2aa5367 Enhance CodeGenConfig #1201

    • Add method loadDefaultConfig() to simplify usage
  • e0f2608 Relocate CodeGenConfig from grace-api to grace-bootstrap #1200

  • e166042 Rename beans to propertySourcesPlaceholderConfigurer beanPropertyOverrideConfigurer to keep naming consistent with the CoreConfiguration #1198

  • cf01cbf Refine GroovyPagesTemplateRenderer

    • Remove unused codes
    • Decouple grace-web-gsp from grace-plugin-domain-class
  • 60e7962 Move CamelCaseUrlConverterSpec and HyphenatedUrlConverterSpec from grace-core to the grace-web-common #1189

  • f39e5cf BuildSettings.APP_BASE_DIR: rename base.dir to grails.base.dir #1186

  • e7e1257 Improve EntityTraitInjector and GormTransformer #1184

    • Refactor EntityTraitInjector and GormTransformer
    • Add tests
  • 17e7afe Remove the configuration of system properties in GrailsGradlePlugin.configureGrailsBuildSettings() #1173 #1157

  • 7ff8e8b Update GspCompileOptions: remove the use of deprecated AbstractOptions #1166 #1165

  • f7e33da Enhance FindMainClassTask and GrailsGradlePlugin.registerFindMainClassTask() #1163

  • a7a1a54 Add configDir to GroovyPageForkCompileTask And migrate project.buildDir to project.layout.buildDirectory #1162

  • c284a33 Task compileWebappGroovyPages should dependsOn classes #1161

  • 7b7d827 Update Gradle Version Catalog #1145

  • 99554ca Rename grace-gorm to grace-data properties in the Grace BOM #1144

  • c9ff2fc Improve GroovyCompiler to allow Groovy scripts to be recompiled and reloaded after modification #1142

  • 25a6b25 Ensure that Grace Artefact classes are not registered prematurely into the Spring context #1141

  • aeb8b10 Update .gitattributes to ensure the web fonts are treated as binary #1138

  • 452b092 Migrate to Central Portal OSSRH Staging API #1114

🎯 Refactoring

#1295 Restore grace-web-databinding module c714723

  • Restore grace-web-databinding module
  • Decouple grace-web from grace-databinding
    • GrailsParameterMap and PropertyEditorRegistryUtils use DataBinder.DEFAULT_DATE_FORMAT

#1260 Create grace-web-rest module

  • Introduce RendererRegistryCustomizer #1260
    • RendererRegistryCustomizer allow to customize RendererRegistry, like DefaultRendererRegistryCustomizer, to add more user-defined Renderer

#1254 Refactor GrailsExceptionResolver 1622cf5

  • Introduce GrailsUrlMappingsExceptionResolver to make grace-web-mvc decoupled from grace-web-url-mappings
  • GrailsExceptionResolver should not reuse cached controller attribute to find the given error path
  • Cleanup GrailsWrappedRuntimeException
  • 09ae9a3 Cleanup GrailsWrappedRuntimeException
  • e663697 GrailsExceptionResolver should not reuse cached controller attribute to find the given error path
  • 835e087 Introduce GrailsUrlMappingsExceptionResolver to make grace-web-mvc decoupled from grace-web-url-mappings

#1253 Refactor grace-web-url-mappings c843dd9

  • Relocate CORS related to grace-plugin-url-mappings
  • Remove method setGrailsCorsConfiguration() in UrlMappingsHandlerMapping, use AbstractHandlerMapping.setCorsConfigurations() instead
  • Relocate UrlMappingsErrorPageCustomizer and AnsiConsoleUrlMappingsRendererSpec to grace-plugin-url-mappings
  • 4b83e7c Relocate CORS related to grace-plugin-url-mappings Remove method setGrailsCorsConfiguration() in UrlMappingsHandlerMapping, use AbstractHandlerMapping.setCorsConfigurations() instead
  • 5f7f4df Relocate UrlMappingsErrorPageCustomizer
  • 6ff146e Relocate AnsiConsoleUrlMappingsRendererSpec

#1252 Various improvements related to stack trace logging and exception display 98e54e7

  • ErrorsViewStackTracePrinter should use grailsResourceLocator first
  • And grailsResourceLocator need to set searchLocation to BuildSettings.BASE_DIR
  • Display the relative path of the file associated with the errors
  • Auto-configure StackTraceFilterer bean on GrailsExceptionResolver
  • Improve the log messages of exception's stack trace
  • Fixed StackTracePrinterSpec
  • Add an additional Spring configuration metadata: grails.full.stacktrace
  • Formatting request parameters and log information, the excluded parameters will be marked [FILTERED] in the log
  • 08b15d9 Fixed GrailsExceptionResolverTests
  • dca3b58 Formatting request parameters and log information The excluded parameters will be marked [FILTERED] in the log.
  • 88b8535 Add an additional Spring configuration metadata: grails.full.stacktrace
  • 58c182d Fixed StackTracePrinterSpec
  • 43bf97b Improve the log messages of exception's stack trace
  • 22e53a9 Display the relative path of the file associated with the errors
  • 1f72a6f Auto-configure StackTraceFilterer bean on GrailsExceptionResolver
  • e9895d2 ErrorsViewStackTracePrinter should use grailsResourceLocator first And grailsResourceLocator need to set searchLocation to BuildSettings.BASE_DIR

#1250 Create grace-plugin-taglibs 5057f8f

  • 7dc73ae Create grace-plugin-taglibs Move org/grails/plugins/web/taglib/*TagLib from grace-plugin-gsp to grace-plugin-taglibs #1249

#1248 Consolidate 'grace-web-sitemesh' into 'grace-web-gsp' 7457d09

  • c8ee8a5 Consolidate 'grace-web-sitemesh' into 'grace-web-gsp'

#1247 Make 'grace-web-mvc' decoupled from 'grace-web-sitemesh' efc9af4

  • 44fc005 Make 'grace-web-mvc' decoupled from 'grace-web-sitemesh'
  • a6908f4 Update copyright year to 2025
  • 87dcb0b Remove 'grace-web-common' module #1246

#1246 Consolidate 'grace-web-common' into 'grace-web' 3fdd3e0

  • f45f130 Consolidate 'grace-web-common' into 'grace-web'

#1245 Relocate AnsiConsoleUrlMappingsRenderer UrlMappingsReportCommand from grace-web-url-mappings to grace-plugin-url-mappings 760c80f

  • 686548f Relocate AnsiConsoleUrlMappingsRenderer UrlMappingsReportCommand from grace-web-url-mappings to grace-plugin-url-mappings

#1244 Consolidate 'grace-web-databinding' into 'grace-web-common' a8f066d

  • f030aa0 Consolidate 'grace-web-databinding' into 'grace-web-common'
    • Move DataBinder WebDataBinding WebDataBindingTraitInjector from 'grace-web-databinding' to 'grace-plugin-databinding'
    • Move org/grails/web/databinding/* from 'grace-web-databinding' to 'grace-web-common'

#1243 Consolidate 'grace-web-jsp' into 'grace-web-gsp' 9663510

  • b423a3f Consolidate 'grace-web-jsp' into 'grace-web-gsp'

#1242 Cleanup dependencies 4143506

Relocate ErrorsViewStackTracePrinter GrailsWrappedRuntimeException from grace-web-common to grace-web-mvc
Remove getPagesTemplateEngine() of GrailsApplicationAttributes
Update dependencies

  • grace-web-gsp no longer depends on grace-web-taglib
  • grace-web-common no longer depends on grace-gsp
  • grace-plugin-fields should depends on grace-web-taglib

#1241 'grace-web-gsp-taglib' has been consolidated into 'grace-web-taglib' and 'grace-plugin-gsp' e28ab80

  • 1c31338 Remove grace-web-gsp-taglib module its functionality has been consolidated into grace-web-taglib and grace-plugin-gsp
  • 960c49c Relocate org/grails/plugins/web/taglib/* from grace-web-gsp-taglib to grace-plugin-gsp
  • 0b64c4b Relocate StandaloneTagLibraryLookup from grace-web-gsp-taglib to grace-web-taglib

#1205 Refactor GrailsApplicationLifeCycle 29476e5

  • 8d7161d
    • Rename GrailsApplicationLifeCycle to GrailsApplicationLifecycle
    • Rewrite GrailsApplicationLifecycle using Java
    • Remove GrailsApplicationLifeCycleAdapter
    • Simplify Plugin
    • Rename GrailsApplicationPostProcessor.setGrailsApplicationLifeCycle() to GrailsApplicationPostProcessor.setGrailsApplicationLifecycle()
    • Update GrailsApplicationBuilder

#1204 Refactor Grace Spring Boot and Grace Spring e3af96e

  • f24e041 Move all classes in the grace-spring-boot into grace-spring

The grace-spring-boot module contains some classes related to the Spring framework and Spring Boot,
But now, all of theme have been relocated into grace-spring,
you should use grace-spring directly.

#1203 Refactor Grace Bootstrap b3c3975

Move the classes under the org.grails.config package from grace-core and grace-spring-boot to grace-bootstrap
Move NavigableMap NavigableMapConfig from grace-api to grace-bootstrap
Move ConfigProperties ConfigPropertiesSpec from grace-plugin-core to grace-bootstrap
Rename GroovyConfigPropertySourceLoader YamlPropertySourceLoader package from org.grails.spring.boot.env to org.grails.config.loader

  • ef0eab9 Move ConfigProperties ConfigPropertiesSpec from grace-plugin-core to grace-bootstrap

  • d888ad8

    • Move NavigableMap NavigableMapConfig from grace-api to grace-bootstrap
    • Move ConfigMapSpec NavigableMapSpec from grace-api to grace-bootstrap
  • 204c4eb

    • Rename GroovyConfigPropertySourceLoader YamlPropertySourceLoader package from org.grails.spring.boot.env to org.grails.config.loader
    • Rename package GroovyConfigPropertySourceLoaderSpec YamlPropertySourceLoaderSpec
    • Update grace-plugin-core/src/main/resources/META-INF/spring.factories
  • b43df23

    • Move the classes under the org.grails.config package from grace-core and grace-spring-boot to grace-bootstrap
    • Move CompositeConfig EnvironmentAwarePropertySource NavigableMapPropertySource PrefixedConfig PrefixedMapPropertySource PropertySourcesConfig from grace-core to grace-bootstrap
    • Move NavigableMapNestedEqualitySpec NavigableMapPropertySourceSpec NavigableMapSpringProfilesSpec PropertyResolutionSpec PropertySourceConfigSpec PropertySourcesConfigSpec SystemEnvironmentConfigSpec from grace-core to grace-bootstrap
    • Move GroovyConfigPropertySourceLoader YamlPropertySourceLoader from grace-spring-boot to grace-bootstrap
    • Move GroovyConfigPropertySourceLoaderSpec YamlPropertySourceLoaderSpec from grace-spring-boot to grace-bootstrap

#1202 Relocate Named and Described from grace-bootstrap to grace-api 7dd3a32

#1199 Refactor GrailsApplication 598ffab

  • b903934 Fix doc typos

  • ca81030 Remove method getMetadata() in GrailsApplication GrailsApplication should not depend on Metadata, please use Metadata.getCurrent() instead

  • 0b1c423 Remove deprecated constants in GrailsApplication

    • CONFIG_CLASS
    • DATA_SOURCE_CLASS
    • PROJECT_META_FILE

#1197 Revisit Grace Spring Boot Module 3976243

Move some classes to more appropriate modules

  • 7ba56be Relocate GroovyConfigPropertySourceLoaderSpec YamlPropertySourceLoaderSpec to grace-spring-boot/src/test/groovy/org/grails/spring/boot/env/
  • 117aa7d Relocate ClassEditor PropertiesEditor to grace-spring-boot/src/main/groovy/org/grails/spring/beans/support/
  • 040d93f Move ClassRelativeClassLoader ClassRelativeResourcePatternResolver from grace-spring-boot to grace-plugin-i18n
  • be716c4 Move GrailsPlaceholderConfigurer GrailsBeanPropertyOverrideConfigurer from grace-spring-boot to grace-plugin-core
  • 803a60f Move NavigableMapPropertySource NavigableMapPropertySourceSpec from grace-api to grace-spring-boot

#1196 Refactor IOUtils 1711f51

  • ead6279 Refactor IOUtils Remove SpringIOUtils
    • Using IOUtils instead Deprecated IOUtils.toString(Reader)
    • Using IOUtils.copyToString(Reader)
    • Enhance IOUtils.copy() methods
    • Using FileCopyUtils.copy() to implement

#1195 Migrate to Spring Framework's Resource API 1d34cd4

  • d18a2b9 Use PathMatchingResourcePatternResolver instead of CachingPathMatchingResourcePatternResolver

  • 50cce34 Move ResourceLocator from grace-api to the grace-core

    • Move DefaultResourceLocator from grace-plugin-api to the grace-core
    • Remove org.grails.coreio.PluginPathAwareFileSystemResourceLoader
  • 2a67789 Use StaticResourceLoader in the grace-bootstrap

  • bfec5ab Use built-in classes such as Resource ResourceLoader provided by the Spring framework

The following classes have been removed

  • AbstractFileResolvingResource
  • AntPathMatcher
  • ByteArrayResource
  • ClassPathResource
  • DefaultResourceLoader
  • FileSystemResource
  • FileSystemResourceLoader
  • GrailsByteArrayResource
  • GrailsResource
  • PathMatchingResourcePatternResolver
  • Resource
  • ResourceLoader
  • SpringResource
  • UrlResource

#1194 Refactor Grace API f09d429

  • ff0729e Move Mixin MixinTargetAware from grace-api to grace-core
    Move CacheEntry Pair Triple from grace-api to grace-util
    Move AbstractTypeConvertingMap TypeConvertingMap TypeConvertingMapTests from grace-api to grace-util

  • 813adaf

    • Move CompositeConfig EnvironmentAwarePropertySource PrefixedConfig PrefixedMapPropertySource PropertySourcesConfig from grace-api to the grace-core
    • Move NavigableMapPropertySourceSpec from grace-core to grace-api
    • Move DefaultGrailsPluginTests from grace-plugin-api to grace-test-suite-uber
  • 13a0a0d

    • Move DefaultErrorsPrinter from grace-api to the grace-core
    • Rename NewInstanceCreationException to GrailsClassCreationException and relocate to grace-core
    • Rename GrailsDomainException to GrailsClassException and relocate to grace-core
    • Rename InvalidPropertyException to GrailsPropertyInvalidException and relocate to grace-core
  • 08e06a4

    • Move AbstractGrailsClass AbstractInjectableGrailsClass from grace-api to the grace-core
    • Move InvalidVersionException VersionComparator GrailsPlugin PluginSource from grace-api to the grace-plugin-api
  • aeb674b Move ConfigProperties from grace-api to the grace-plugin-core

  • 784c2d3 Move GrailsFactoriesLoader from grace-api to the grace-bootstrap

  • 42b116b Move Settings from grace-api to the grace-bootstrap

#1193 Refactor GSP plugin 6a440fc

  • 2c8e8ea Remove deprecated GrailsTagLibClass DefaultGrailsTagLibClass TagLibArtefactHandler
  • ae9039a Make ControllerTagLibraryTraitInjector inherit directly from TraitInjectorAdapter
  • 1514bd3 Use ArtefactTypes.TAG_LIBRARY instead of TagLibArtefactHandler.TYPE

#1192 Refactor Bootstrap Artefact 0ae405b

  • 30ababb Relocate BootstrapArtefactHandler BootstrapArtefactHandlerSpec to grace-boot

    • Move GrailsBootstrapClass DefaultGrailsBootstrapClass from grace-web to grace-boot
    • Update GrailsApplicationBuilder
  • 2c585fe Auto-configure BootstrapClassRunner

    • Move BootstrapClassRunner from grace-plugin-controllers to grace-boot
    • Rename BootstrapClassRunner to GrailsBootstrapClassRunner
    • Auto-configure GrailsBootstrapClassRunner in GrailsBootstrapAutoConfiguration
    • Add grails.bootstrap.skip to Spring Configuration Metadata
  • 7d7a392 Use ArtefactTypes.BOOTSTRAP instead of BootstrapArtefactHandler.TYPE

#1191 Refactor Grace Boot 86e998f

  • d1cccad Refactor Grace Boot
    • Move ApplicationArtefactHandler ApplicationClassInjector from grace-core to grace-boot
    • Move LoggingTransformerSpec from grace-logging to grace-boot
    • Update ArtefactTypeAstTransformationSpec GlobalGrailsClassInjectorTransformationSpec GrailsAwareInjectionOperationSpec

#1190 Refactor Services plugin 907ece2

  • df08a97 Refactor Services plugin
    • Use ArtefactTypes.SERVICE instead of ServiceArtefactHandler.TYPE
    • Move GrailsServiceClass DefaultGrailsServiceClass from grace-core to grace-plugin-services
    • Relocate ServiceArtefactHandler ServiceArtefactHandlerSpec to grace-plugin-services
    • Update ServiceUnitTest

#1189 Refactor Controllers and Controllers plugins ba72157

  • 50ba03c Move DefaultGrailsControllerClassSpec to the grace-plugin-controllers

  • d053ffb Refactor UrlMappings plugin

    • Use ArtefactTypes.URL_MAPPINGS instead of UrlMappingsArtefactHandler.TYPE
    • Move GrailsUrlMappingsClass DefaultGrailsUrlMappingsClass from grace-core to grace-web-common
    • Relocate UrlMappingsArtefactHandler UrlMappingsArtefactHandlerSpec to grace-plugin-url-mappings
  • cb14e53 Refactor Controllers plugin

    • Use ArtefactTypes.CONTROLLER instead of ControllerArtefactHandler.TYPE
    • Move Action CamelCaseUrlConverter HyphenatedUrlConverter UrlConverter from grace-core to grace-web-common
    • Relocate ControllerArtefactHandler ControllerArtefactHandlerSpec to grace-plugin-controllers
    • Update LoggingTransformerSpec in grace-logging
    • Add ControllerLoggingTransformerSpec to grace-plugin-controllers

#1188 Refactor Domain Class plugin eb281db

  • 38d8a3c Relocate DomainClassArtefactHandler to grace-plugin-domain-class
  • 77b08ec Decouple DefaultGrailsApplication.addArtefact() from DomainClassArtefactHandler
  • 8c0bfeb Introduce ArtefactTypes - Use ArtefactTypes.DOMAIN_CLASS instead of DomainClassArtefactHandler.TYPE
  • ff33e4e Use GrailsASTUtils.isDomainClass() instead of DomainClassArtefactHandler.isDomainClass()

#1187 Refactor Domain Class plugin 8fb1916

  • cafca11 Remove AnnotationDomainClassArtefactHandler
  • 54f732a Relocate DefaultGrailsDomainClassInjector to grace-plugin-domain-class

#1185 Refactor Domain Class plugin ac7f0ac

  • 2c627bc Decouple grace-core from grace-plugin-domain-class
    • Update tests
    • Move tests from grace-core into grace-plugin-domain-class

#1183 Merge async and events plugins into the framework 8d780cc

  • ccca4bf Code format
  • 35eef92 Build async and events plugins
    • Add grace-plugin-async and grace-plugin-events
    • Use Gradle version catalog to manage dependencies
    • Add version and descriptor to plugins
    • Update TransactionalPromiseDecorator and make tests pass

#1182 Restructure GORM Support 8853c8c

#1180 Refactor Gradle Doc Plugin 3f68dc3

  • 50977dc Refactor DocPublisher

    • Rename publishPdf() to generatePdfGuide()
    • Remove PublishPdfTask
  • 4b19463 Refactor GrailsDocGradlePlugin

    • Rename docs to publishGuide
    • Add new properties singlePdf generatePdf to PublishGuideTask
    • Remove registed task docsPdf

#1176 Refactor Gradle Doc Plugin a7386c2

  • b047043 Remove obsolete MigrateLegacyDocs
  • 4be1766 Refactor PublishGuideTask - Migrate all properties to lazy properties
  • cc876a3 Refactor PublishGuideTask Remove Gradle's deprecation warning "Invocation of Task.project at execution time has been deprecated."

#1175 Refactor Grace Banner 8b4f907

  • 205a718 Refactor GrailsResourceBanner

    • Align with Spring Boot's ResourceBanner
    • Don't return the default application name in Metadata.getApplicationName()
    • Add GrailsResourceBannerTests
  • efe2899 Refactor GrailsResourceBanner

    • Remove deprecated method getApplicationVersion(Class<?> sourceClass)
    • Get name and version from environment

#1174 Refactor Gradle plugins 3c7f267

  • edc3a51 Refactor GrailsGradlePlugin

    • Remove enableNative2Ascii() in favor of using Gradle's ProcessResources
    • Deprecated native2ascii and native2asciiAnt in GrailsExtension
  • b4a4643 Refine GrailsPluginGradlePlugin

    • Add ProcessPluginResourcesTask
    • Improve configurePluginResources()
  • dc80af8 Refine GrailsGradlePlugin and GrailsWebGradlePlugin

    • Add configureProcessResources() for GrailsWebGradlePlugin
    • Extract copying templates from GrailsGradlePlugin.enableNative2Ascii() to GrailsWebGradlePlugin

#1172 Refactor Gradle Profile Plugin 8008127

  • 8f89eb1 Refactor GrailsProfileGradlePlugin

    • Add constants PROCESS_PROFILE_RESOURCES_TASK_NAME COMPILE_PROFILE_TASK_NAME PROFILE_GROUP
    • Add registerOrGetJarTask() and registerOrGetSourcesJarTask()
    • Improve sourcesJarTask
  • 4a39330 Refactor GrailsProfileGradlePlugin

    • Add ProfileResourcesProcessTask
    • Improve ProfileCompilerTask
    • Refactor GrailsProfileGradlePlugin

#1171 Support configuration of project resources and sources directories 5821a9c

  • 8746471 Configure the main sources and resources directories This PR allow developers to configure the app sources and resources,
grails {
    appSourceDirs += ['models', 'repositories']
    appResourceDirs += ['config']
}

#1170 Customize Groovy compiler configuration 4a64a9e

  • 991d10b Support adding user defined node metadata This PR allow develpers to add some user defined node metadata by configuring configScript.metaDataMap,
configScript {
    metaDataMap['APP_THEME'] = 'custom meta data'
}
  • 949d829 Allow to provide a custom Groovy script file that configures the Groovy compiler The default Groovy script file should be placed in config/groovy/compiler.groov,
withConfig(configuration) {
    inline(phase: 'CONVERSION') { source, context, classNode ->
        source.ast.putNodeMetaData('PROJECT_NAME', '${PROJECT_NAME}')
        source.ast.putNodeMetaData('PROJECT_TYPE', '${PROJECT_TYPE}')
        source.ast.putNodeMetaData('PROJECT_VERSION', '${PROJECT_VERSION}')
        source.ast.putNodeMetaData('PROJECT_DIR', '${PROJECT_DIR}')
        source.ast.putNodeMetaData('GRAILS_APP_DIR', '${GRAILS_APP_DIR}')
    }
}

#1169 Refactor Gradle plugins eb884d5

  • 7d686e4 Refactor GrailsGradlePlugin

    • Introduce GenerateBuildInfo
    • Remove @CompileDynamic on createBuildPropertiesTask()
  • 4aba8f5 Refactor GrailsGradlePlugin

    • Introduce GenerateConfigScript
    • Rename configureGroovyASTMetadata() to configureGroovyCompiler()

#1168 Refactor Gradle plugins 3b4ba01

  • e775f01 Configure the classpath of the Spring Boot's BootArchive
  • cf8fb3a Change the generated gsp class name: remove the prefixed 'gsp', and append '_' before the view names
  • 31817da Change the compiled gsp classes target directory
  • 1fb9311 Correct the Groovy build classes dirs

#1167 Refactor Gradle plugins e844d7e

  • 76633b6 Improve GroovyPagePlugin and GroovyPageForkCompileTask

    • Remove unnecessary dependency on jakarta.servlet-api
    • Remove Configuration providedCompile, only use compileClasspath
    • Don't call Task.getProject() from a task action
    • Use JavaPlugin.CLASSES_TASK_NAME instead of classes
    • Use GrailsGradlePlugin.GRAILS_EXTENSION_NAME
  • dbe50eb Refactor GrailsProfileGradlePlugin

    • Use BasePlugin.ASSEMBLE_TASK_NAME instead of assemble
    • Rename CONFIGURATION_NAME to GRAILS_CONFIGURATION_NAME
    • Rename RUNTIME_CONFIGURATION to PROFILE_CONFIGURATION_NAME
    • Use Groovy style project.configurations and project.extensions
  • 9cdf38f Update ApplicationContextCommandTask and ApplicationContextScriptTask

    • Remove dependsOn of the tasks ApplicationContextCommandTask and ApplicationContextScriptTask
    • Configure dependsOn when registering the tasks
  • 5011c46 Refactor GrailsGradlePlugin

    • Use JavaPlugin.CLASSES_TASK_NAME instead of classes
    • Use Groovy style project.configurations and project.extensions
    • Add GRAILS_EXTENSION_NAME FIND_MAIN_CLASS_TASK_NAME BUILD_PROPERTIES_TASK_NAME
    • Rename CONSOLE_CONFIGURATION to CONSOLE_CONFIGURATION_NAME
    • Rename PROFILE_CONFIGURATION to PROFILE_CONFIGURATION_NAME
    • Remove addDefaultProfile()

#1164 Refactor Gradle Plugins cd3486d

  • 383a6be Improve GrailsPluginGradlePlugin

    • Use constant name of the Task and Configuration
    • Use tasks.register() instead of tasks.create()
    • Cleanup codes
  • d5de8f5 Configure the main application class name fo runScript task

  • bbf1781 refactor configureGrailsBuildSettings() and configureSpringBootExtension()

    • Change configureGrailsBuildSettings() return to void
    • Migrate deprecated project.buildDir
    • Add helper methods to SourceSets
  • 85c0691 refactor configurePathingJar

    • Enhance buildClasspath()
    • Use project.layout.buildDirectory instead of project.buildDir
    • Make resolveClassesDirs() private
  • 979f6c6 refactor enableNative2Ascii()

    • Use inline ant.native2ascii()
    • Remove createNative2AsciiTask
  • ff169eb refactor createBuildPropertiesTask()

    • Change its return type to void
    • Use tasks.register() instead of tasks.create()
    • Make build properties ordered
  • 1b8aa4b refactor configureConsoleTask()

    • Remove createConsoleTask() and createShellTask
    • Use tasks.register() instead of tasks.create()
  • b544809 refactor configureApplicationCommands()

    • Use tasks.register() instead of tasks.create()
    • Remove unnecessary @CompileDynamic
  • 1e45f77 refactor configureRunScript() and configureRunCommand()

    • Use tasks.register() instead of tasks.create()
    • Remove unnecessary @CompileDynamic
  • eb83712 refactor configureGroovyASTMetadata()

    • Use tasks.register() instead of tasks.create()
    • Use tasks.named() instead of tasks.getByName()
    • Remove unnecessary @CompileDynamic

#1157 Allow developers to customize the app directory 2ee497b

Grails employs a structured directory layout that organizes files and folders based on their functionality, which is essential for maintaining code in a large application.

The app directory is central to a Grails application, containing subdirectories for domains, services, views, controllers, taglibs and assets, which follow the MVC architectural pattern.

In the past, Grails has always adhered to the convention of using grails-app as a fixed directory since its inception. In Grace, we can use grails-app, or the more concise app.
Now, in the upcoming Grace 2024 version, we take it a step further by allowing developers to customize this directory. You are free to choose a more suitable specific directory, such as web, admin, api, or store.

#1149 Application type artifacts are supported in both the app/boot and src/main directories 5b594a8

  • 5bf8c08 Application type artifacts are supported in both the app/boot and src/main directories
    • Move from app/init to app/boot
    • Update releated tests

#1148 Move artefact Bootstrap.groovy from app\init to app\boot 09ab913

#1147 Rename artefact type BootStrap to Bootstrap e1b61a4

  • 512f9d6 Rename BootStrap.groovy to Bootstrap.groovy
    • Update DefaultGrailsBootstrapClass.BOOT_STRAP to Bootstrap as the trailing part of the Bootstrap class type
    • Rename BootStrapClassRunner to BootstrapClassRunner
    • Change the bean name to bootstrapClassRunner in ControllersGrailsPlugin
    • Update the other related tests
    • We should also update the base profile

#1140 Refactor GroovyCompiler ae3ef71

  • 1f64e96 Improve GroovyCompiler for better compilation of Groovy scripts #1139

Only use Groovy Grape's runtime dependencies to load ArtefactHandler ClassInjector TraitInjector, so the Shell no longer need grace-plugin-controllers grace-plugin-gsp grace-plugin-url-mappings, which greatly reduces the size of the final CLI installation package.

  • Introduce GrailsArtefactClassTransformation
  • Remove some runtime dependencies of grace-shell
  • Add support methods in TraitInjectionUtils
  • Cleanup ExtendedGroovyClassLoader

#1136 Refactor the core API of the framework b0d5f75

This is a very important code refactoring and update for the framework.

Initially, I intended to run a Single-File Application Groovy script in the CLI, but after analyzing a lot of the framework's underlying code, I found that these core API were very difficult to extend and test, so I began a painful code refactoring journey.

After the refactoring, it has now become possible to successfully run a Single-File Application Groovy script in the CLI.

Refactoring involves several important APIs of Grails. I believe that refactoring these classes is significant for the maintenance and updating of the framework, and it is also very helpful for third-party plugin developers, making plugins and libraries easy to extend and test.

  • ArtefactHandler
  • ClassInjector
  • TraitInjector
  • GlobalGrailsClassInjectorTransformation
  • GlobalGrailsPluginTransformation
  • GrailsASTUtils
  • GrailsGradlePlugin

ArtefactHandler

  • Relocate ArtefactHandlerAdapter to grace-core
  • Support Grails and GORM Entity for DomainClassArtefactHandler.isArtefactClass
  • Refactor isDomainClass() in DomainClassArtefactHandler
  • Refactor ControllerArtefactHandler
  • Refactor TagLibArtefactHandler
  • Support taglib with annotation @TagLib for TagLibArtefactHandler
  • Remove supports for @TagLibrary as artefact type, use @TagLib instead
  • Adding Spock tests for ArtefactHandlers
  • Adding @Artefact() annotation to Grails artefacts in the tests

ClassInjector

  • Refactor ClassInjector
  • Add support for ClassInjector ordering
  • Using GrailsFactoriesLoader to load ClassInjector
  • Update BootInitializerClassInjector
  • Refactor ApplicationClassInjector
  • Refactor DefaultGrailsDomainClassInjector
  • Refactor AbstractGrailsArtefactTransformer
  • Refactor ArtefactTypeAstTransformation
  • Refactor ControllerActionTransformer
  • Refactor ControllerDomainTransformer
  • Refactor LoggingTransformer
  • Refactor ResourceTransform
  • Refactor TagLibraryTransformer
  • Deprecated SupportsClassNode
  • Deprecated ClassInjector.shouldInject(URL), in favor of shouldInject(ClassNode)

TraitInjector

  • Introduce TraitInjectorAdapter
  • Using boolean supports(ClassNode) to check if the classNode need to be injected
  • Add support for TraitInjector ordering
  • Refactor TraitInjectionUtils
  • Deprecated TraitInjectionSupport
  • Deprecated GlobalClassInjector and GlobalClassInjectorAdapter

GrailsASTUtils

  • Adding more methods to check whether the specified source is a Grails project source
  • Adding method getGrailsArtefactType() to GrailsASTUtils
  • Refactor isDomainClass() in GrailsASTUtils

GrailsGradlePlugin: configure Groovy AST Metadata for configurationScript of GroovyCompileOptions

  • GRAILS_APP_DIR
  • PROJECT_DIR
  • PROJECT_NAME
  • PROJECT_TYPE
  • PROJECT_VERSION

GlobalGrailsClassInjectorTransformation and GlobalGrailsPluginTransformation

  • Refactor GlobalGrailsClassInjectorTransformation
  • Refine GlobalGrailsPluginTransformation
  • Update GlobalGrailsPluginTransformationSpec

Grails with Spring Boot DevTools

  • Initial integration of Grails with Spring Boot DevTools
  • Add GrailsSourceCompiler
  • Remove deprecated DirectoryWatcher related

RunCommand

  • Initial support Grails Single File Application running in CLI
  • Allow Grails load the specified primary sources
  • Add GrailsGormCompilerAutoConfiguration
  • Update GroovyCompiler
  • Update GrailsApplicationCompilerAutoConfiguration

🚀 Dependency Upgrades

⚙️ Tasks

  • e696d68 Bump gradle/actions from 4.0.0 to 4.4.2
  • 0a6ce4a Bump actions/checkout from 4 to 5
  • 5cfc699 Update GitHub workflows - Switch to 2024.0.x
  • 5815eee Next development version: 2024.0.0-SNAPSHOT

🍀 Grace Projects

📜 Grace Profiles

Full Changelog: v2024.0.0-M1...v2024.0.0-M2